summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2008-01-15 14:43:19 -0500
committerJohn (J5) Palmieri <johnp@redhat.com>2008-01-15 14:43:19 -0500
commit85d7a8e4d7e192ab886633f0a223cc9abb47e506 (patch)
treee32bd21aa520e4bcdc34af0377446e8a48396e27
parent9db435926fb82409caa2b5a7139781a95f105a63 (diff)
add OOM handling in various places
2008-01-15 John (J5) Palmieri <johnp@redhat.com> * patches by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com> * dbus/dbus-sysdeps-unix (_dbus_get_autolaunch_address): handle OOM (FDO Bug #12945) * dbus/dbus-uuidgen.c (return_uuid): handle OOM (FDO Bug #12928) * dbus/dbus-misc.c (dbus_get_local_machine_id): handle OOM, fix return value to return NULL not FALSE (FDO Bug #12946)
-rw-r--r--ChangeLog12
-rw-r--r--dbus/dbus-misc.c7
-rw-r--r--dbus/dbus-sysdeps-unix.c6
-rw-r--r--dbus/dbus-uuidgen.c8
4 files changed, 29 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index b254f8ee..72e50337 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2008-01-15 John (J5) Palmieri <johnp@redhat.com>
+ * patches by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
+
+ * dbus/dbus-sysdeps-unix (_dbus_get_autolaunch_address): handle OOM
+ (FDO Bug #12945)
+
+ * dbus/dbus-uuidgen.c (return_uuid): handle OOM (FDO Bug #12928)
+
+ * dbus/dbus-misc.c (dbus_get_local_machine_id): handle OOM, fix return
+ value to return NULL not FALSE (FDO Bug #12946)
+
+2008-01-15 John (J5) Palmieri <johnp@redhat.com>
+
* bus/bus.c (bus_context_check_security_policy): rewrite selinux error
handling to not abort due to a NULL read and to set the error only if
it is not already set (Based off of FDO Bug #12430)
diff --git a/dbus/dbus-misc.c b/dbus/dbus-misc.c
index 22b7333e..758e1a02 100644
--- a/dbus/dbus-misc.c
+++ b/dbus/dbus-misc.c
@@ -76,12 +76,15 @@ dbus_get_local_machine_id (void)
char *s;
s = NULL;
- _dbus_string_init (&uuid);
+
+ if (!_dbus_string_init (&uuid))
+ return NULL;
+
if (!_dbus_get_local_machine_uuid_encoded (&uuid) ||
!_dbus_string_steal_data (&uuid, &s))
{
_dbus_string_free (&uuid);
- return FALSE;
+ return NULL;
}
else
{
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
index c4866bbb..dfa71e7d 100644
--- a/dbus/dbus-sysdeps-unix.c
+++ b/dbus/dbus-sysdeps-unix.c
@@ -2777,7 +2777,11 @@ _dbus_get_autolaunch_address (DBusString *address,
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
retval = FALSE;
- _dbus_string_init (&uuid);
+ if (!_dbus_string_init (&uuid))
+ {
+ _DBUS_SET_OOM (error);
+ return FALSE;
+ }
if (!_dbus_get_local_machine_uuid_encoded (&uuid))
{
diff --git a/dbus/dbus-uuidgen.c b/dbus/dbus-uuidgen.c
index 0038cd74..6f226bce 100644
--- a/dbus/dbus-uuidgen.c
+++ b/dbus/dbus-uuidgen.c
@@ -48,7 +48,13 @@ return_uuid (DBusGUID *uuid,
if (uuid_p)
{
DBusString encoded;
- _dbus_string_init (&encoded);
+
+ if (!_dbus_string_init (&encoded))
+ {
+ _DBUS_SET_OOM (error);
+ return FALSE;
+ }
+
if (!_dbus_uuid_encode (uuid, &encoded) ||
!_dbus_string_steal_data (&encoded, uuid_p))
{