[maemo-commits] [maemo-commits] r14626 - in projects/haf/trunk/dbus/debian: . patches

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Oct 26 11:25:08 EEST 2007
Author: kihamala
Date: 2007-10-26 11:25:07 +0300 (Fri, 26 Oct 2007)
New Revision: 14626

Added:
   projects/haf/trunk/dbus/debian/patches/31-add-oom-checks.patch
Modified:
   projects/haf/trunk/dbus/debian/changelog
Log:
add missing OOM checks to dbus-internals.c


Modified: projects/haf/trunk/dbus/debian/changelog
===================================================================
--- projects/haf/trunk/dbus/debian/changelog	2007-10-26 08:00:55 UTC (rev 14625)
+++ projects/haf/trunk/dbus/debian/changelog	2007-10-26 08:25:07 UTC (rev 14626)
@@ -17,6 +17,7 @@
   * Add one more OOM check to return_uuid.
   * Add one more OOM check to _dbus_get_autolaunch_address.
   * Fixes to dbus_get_local_machine_id.
+  * Add missing OOM checks to dbus-internals.c.
 
  -- Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>  Thu, 18 Oct 2007 11:21:11 +0300
 

Added: projects/haf/trunk/dbus/debian/patches/31-add-oom-checks.patch
===================================================================
--- projects/haf/trunk/dbus/debian/patches/31-add-oom-checks.patch	2007-10-26 08:00:55 UTC (rev 14625)
+++ projects/haf/trunk/dbus/debian/patches/31-add-oom-checks.patch	2007-10-26 08:25:07 UTC (rev 14626)
@@ -0,0 +1,37 @@
+diff -pur dbus-1.0.2/dbus/dbus-internals.c dbus-1.0.2.new/dbus/dbus-internals.c
+--- dbus-1.0.2/dbus/dbus-internals.c	2006-12-11 21:21:06.000000000 +0200
++++ dbus-1.0.2.new/dbus/dbus-internals.c	2007-10-26 11:18:45.811685424 +0300
+@@ -539,8 +539,18 @@ _dbus_read_uuid_file_without_creating (c
+   DBusString decoded;
+   int end;
+   
+-  _dbus_string_init (&contents);
+-  _dbus_string_init (&decoded);
++  if (!_dbus_string_init (&contents))
++    {
++      _DBUS_SET_OOM (error);
++      return FALSE;
++    }
++
++  if (!_dbus_string_init (&decoded))
++    {
++      _dbus_string_free (&contents);
++      _DBUS_SET_OOM (error);
++      return FALSE;
++    }
+   
+   if (!_dbus_file_get_contents (&contents, filename, error))
+     goto error;
+@@ -604,7 +614,11 @@ _dbus_create_uuid_file_exclusively (cons
+ {
+   DBusString encoded;
+ 
+-  _dbus_string_init (&encoded);
++  if (!_dbus_string_init (&encoded))
++    {
++      _DBUS_SET_OOM (error);
++      return FALSE;
++    }
+ 
+   _dbus_generate_uuid (uuid);
+   


More information about the maemo-commits mailing list