dbus/dbus dbus-pending-call.c,1.17,1.18

John Palmieri johnp at kemper.freedesktop.org
Tue Sep 5 15:05:14 PDT 2006


Update of /cvs/dbus/dbus/dbus
In directory kemper:/tmp/cvs-serv27309/dbus

Modified Files:
	dbus-pending-call.c 
Log Message:
* dbus/dbus-pending-call.c: Add some checks so we don't crash on
  NULL in the public API (Patch from Kimmo Hämäläinen 
  <kimmo dot hamalainen at nokia dot com>)


Index: dbus-pending-call.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-pending-call.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- dbus-pending-call.c	16 Aug 2006 22:30:15 -0000	1.17
+++ dbus-pending-call.c	5 Sep 2006 22:05:12 -0000	1.18
@@ -547,6 +547,8 @@
 void
 dbus_pending_call_cancel (DBusPendingCall *pending)
 {
+  _dbus_return_if_fail (pending != NULL);
+
   _dbus_connection_remove_pending_call (pending->connection,
                                         pending);
 }
@@ -576,6 +578,8 @@
 {
   dbus_bool_t completed;
   
+  _dbus_return_val_if_fail (pending != NULL, FALSE);
+
   CONNECTION_LOCK (pending->connection);
   completed = pending->completed;
   CONNECTION_UNLOCK (pending->connection);
@@ -597,6 +601,7 @@
 {
   DBusMessage *message;
   
+  _dbus_return_val_if_fail (pending != NULL, NULL);
   _dbus_return_val_if_fail (pending->completed, NULL);
   _dbus_return_val_if_fail (pending->reply != NULL, NULL);
 
@@ -627,6 +632,8 @@
 void
 dbus_pending_call_block (DBusPendingCall *pending)
 {
+  _dbus_return_if_fail (pending != NULL);
+
   _dbus_connection_block_pending_call (pending);
 }
 
@@ -650,6 +657,8 @@
 dbus_bool_t
 dbus_pending_call_allocate_data_slot (dbus_int32_t *slot_p)
 {
+  _dbus_return_val_if_fail (slot_p != NULL, FALSE);
+
   return _dbus_data_slot_allocator_alloc (&slot_allocator,
                                           &_DBUS_LOCK_NAME (pending_call_slots),
                                           slot_p);
@@ -669,6 +678,7 @@
 void
 dbus_pending_call_free_data_slot (dbus_int32_t *slot_p)
 {
+  _dbus_return_if_fail (slot_p != NULL);
   _dbus_return_if_fail (*slot_p >= 0);
 
   _dbus_data_slot_allocator_free (&slot_allocator, slot_p);



More information about the dbus-commit mailing list