dbus/bus desktop-file.c,1.14,1.15 dispatch.c,1.77,1.78

David Zeuthen david at kemper.freedesktop.org
Mon Oct 23 10:25:54 PDT 2006


Update of /cvs/dbus/dbus/bus
In directory kemper:/tmp/cvs-serv31767/bus

Modified Files:
	desktop-file.c dispatch.c 
Log Message:
2006-10-23  David Zeuthen  <davidz at redhat.com>

        * dbus/dbus-memory.c: Use atomic variable to protect
        n_blocks_outstanding otherwise OOM will be reported using SMP on
        some arches
        
        * bus/dispatch.c: Add missing end of line characters

        * bus/desktop-file.c (parse_section_start, parse_key_value) 
        (bus_desktop_file_load): Propertly handle OOM

        * dbus/dbus-threads.c (init_uninitialized_locks): Check that
        thread_init_generation equals _dbus_current_generation, not 0



Index: desktop-file.c
===================================================================
RCS file: /cvs/dbus/dbus/bus/desktop-file.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- desktop-file.c	11 Sep 2006 15:24:10 -0000	1.14
+++ desktop-file.c	23 Oct 2006 17:25:52 -0000	1.15
@@ -430,6 +430,8 @@
   if (open_section (parser, section_name) == NULL)
     {
       dbus_free (section_name);
+      parser_free (parser);
+      BUS_SET_OOM (error);
       return FALSE;
     }
 
@@ -527,6 +529,7 @@
     {
       dbus_free (value);
       parser_free (parser);
+      BUS_SET_OOM (error);
       return FALSE;
     }
   
@@ -534,21 +537,26 @@
     {
       dbus_free (value);
       parser_free (parser);
+      BUS_SET_OOM (error);
       return FALSE;
     }
   
   if (!_dbus_string_copy_len (&parser->data, key_start, key_end - key_start,
                               &key, 0))
     {
+      _dbus_string_free (&key);
       dbus_free (value);
       parser_free (parser);
+      BUS_SET_OOM (error);
       return FALSE;
     }
   
   if (!_dbus_string_steal_data (&key, &tmp))
     {
+      _dbus_string_free (&key);
       dbus_free (value);
       parser_free (parser);
+      BUS_SET_OOM (error);
       return FALSE;
     }
   
@@ -633,7 +641,10 @@
     }
   
   if (!_dbus_string_init (&str))
-    return NULL;
+    {
+      BUS_SET_OOM (error);
+      return NULL;
+    }
   
   if (!_dbus_file_get_contents (&str, filename, error))
     {

Index: dispatch.c
===================================================================
RCS file: /cvs/dbus/dbus/bus/dispatch.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- dispatch.c	1 Oct 2006 15:36:18 -0000	1.77
+++ dispatch.c	23 Oct 2006 17:25:52 -0000	1.78
@@ -581,7 +581,7 @@
           || (d->expected_kind == OWNER_CHANGED   && (!old_owner[0] || !new_owner[0]))
           || (d->expected_kind == SERVICE_DELETED && (!old_owner[0] ||  new_owner[0])))
         {
-          _dbus_warn ("inconsistent NameOwnerChanged arguments");
+          _dbus_warn ("inconsistent NameOwnerChanged arguments\n");
           goto out;
         }
 
@@ -2359,7 +2359,7 @@
             }
           else
             {
-              _dbus_warn ("unexpected arguments for NameOwnerChanged message");
+              _dbus_warn ("unexpected arguments for NameOwnerChanged message\n");
               message_kind = GOT_SOMETHING_ELSE;
             }
         }
@@ -2556,12 +2556,13 @@
             if (message_kind != GOT_ERROR)
               {
                 block_connection_until_message_from_bus (context, connection, "error about service exiting");
-              
+		
                 /* and process everything again */
                 bus_test_run_everything (context);
               
                 if (!check_got_error (context, connection,
                                       DBUS_ERROR_SPAWN_CHILD_EXITED,
+				      DBUS_ERROR_NO_MEMORY,
                                       NULL))
                   goto out;
               }
@@ -3109,7 +3110,7 @@
       if (message == NULL)
         {
           _dbus_warn ("No message after auto activation "
-                      "(should be a service announcement)");
+                      "(should be a service announcement)\n");
           dbus_connection_return_message (connection, message);
           message = NULL;
           goto out;
@@ -3398,7 +3399,7 @@
       if (message == NULL)
         {
           _dbus_warn ("No message after auto activation "
-                      "(should be a service announcement)");
+                      "(should be a service announcement)\n");
           dbus_connection_return_message (connection, message);
           message = NULL;
           goto out;
@@ -3489,7 +3490,7 @@
                                        DBUS_TYPE_STRING, &argv[6],
                                        DBUS_TYPE_INVALID))
     {
-      _dbus_warn ("Error getting arguments from return");
+      _dbus_warn ("Error getting arguments from return\n");
       goto out;
     }
 
@@ -3498,42 +3499,42 @@
    */
   if (strcmp("-test", argv[1]) != 0)
     {
-      _dbus_warn ("Unexpected argv[1] in shell success service test (expected: %s, got: %s)", 
+      _dbus_warn ("Unexpected argv[1] in shell success service test (expected: %s, got: %s)\n", 
                   "-test", argv[1]);
       goto out;
     } 
 
   if (strcmp("that", argv[2]) != 0)
     {
-      _dbus_warn ("Unexpected argv[2] in shell success service test (expected: %s, got: %s)", 
+      _dbus_warn ("Unexpected argv[2] in shell success service test (expected: %s, got: %s)\n", 
                    "that", argv[2]);
       goto out;
     } 
 
   if (strcmp("we get", argv[3]) != 0)
     {
-      _dbus_warn ("Unexpected argv[3] in shell success service test (expected: %s, got: %s)", 
+      _dbus_warn ("Unexpected argv[3] in shell success service test (expected: %s, got: %s)\n", 
                    "we get", argv[3]);
       goto out;
     } 
    
   if (strcmp("back", argv[4]) != 0)
     {
-      _dbus_warn ("Unexpected argv[4] in shell success service test (expected: %s, got: %s)", 
+      _dbus_warn ("Unexpected argv[4] in shell success service test (expected: %s, got: %s)\n", 
                    "back", argv[4]);
       goto out;
     } 
 
   if (strcmp("--what", argv[5]) != 0)
     {
-      _dbus_warn ("Unexpected argv[5] in shell success service test (expected: %s, got: %s)", 
+      _dbus_warn ("Unexpected argv[5] in shell success service test (expected: %s, got: %s)\n", 
                    "--what", argv[5]);
       goto out;
     } 
 
   if (strcmp("we put in", argv[6]) != 0)
     {
-      _dbus_warn ("Unexpected argv[6] in shell success service test (expected: %s, got: %s)", 
+      _dbus_warn ("Unexpected argv[6] in shell success service test (expected: %s, got: %s)\n", 
                    "we put in", argv[6]);
       goto out;
     } 
@@ -3880,7 +3881,7 @@
 	case GOT_ERROR:
 	case GOT_SERVICE_DELETED:
 	  _dbus_warn ("Unexpected message after ActivateService "
-		      "(should be an error or a service announcement");
+		      "(should be an error or a service announcement)\n");
 	  goto out;
 
 	case GOT_SERVICE_CREATED:
@@ -3955,7 +3956,7 @@
   
   if (!check_no_leftovers (d->context))
     {
-      _dbus_warn ("Messages were left over, should be covered by test suite");
+      _dbus_warn ("Messages were left over, should be covered by test suite\n");
       return FALSE;
     }
 
@@ -4057,7 +4058,7 @@
   
   if (!check_no_leftovers (context))
     {
-      _dbus_warn ("Messages were left over after setting up initial connections");
+      _dbus_warn ("Messages were left over after setting up initial connections\n");
       _dbus_assert_not_reached ("initial connection setup failed");
     }
   



More information about the dbus-commit mailing list