]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
add OOM handling in various places
authorJohn (J5) Palmieri <johnp@redhat.com>
Tue, 15 Jan 2008 19:43:19 +0000 (14:43 -0500)
committerJohn (J5) Palmieri <johnp@redhat.com>
Tue, 15 Jan 2008 19:43:19 +0000 (14:43 -0500)
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)

ChangeLog
dbus/dbus-misc.c
dbus/dbus-sysdeps-unix.c
dbus/dbus-uuidgen.c

index b254f8ee1039beaf36bf30765e59c4f73ebb1eb8..72e50337bc8018d2d4e08ec041d37b7c134cb4cb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+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
index 22b7333e7e300706a9f955e2e65c0cf35b1d6c49..758e1a02f54ebd64d98392a55707feb8272a4801 100644 (file)
@@ -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
     {
index c4866bbbb215487e0a711b6e812abd2a6fed7179..dfa71e7d01cf687078e2035e5bb64e226078a25b 100644 (file)
@@ -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))
     {
index 0038cd7415a8e975866367d54ef4b7a8aa843646..6f226bcef83934cc13cd768a46c279f77a57e29e 100644 (file)
@@ -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))
         {