[patch] fix selinux OOM and memory leak

Colin Walters walters at verbum.org
Tue Apr 12 16:01:38 PDT 2005


Index: bus/bus.c
===================================================================
RCS file: /cvs/dbus/dbus/bus/bus.c,v
retrieving revision 1.60
diff -u -p -r1.60 bus.c
--- bus/bus.c   17 Feb 2005 21:19:49 -0000      1.60
+++ bus/bus.c   12 Apr 2005 22:09:10 -0000
@@ -1139,8 +1139,16 @@ bus_context_check_security_policy (BusCo
                                    dbus_message_get_interface
(message),
                                    dbus_message_get_member (message),
                                    dbus_message_get_error_name
(message),
-                                   dest ? dest : DBUS_SERVICE_DBUS))
+                                   dest ? dest : DBUS_SERVICE_DBUS,
error))
         {
+
+         if (dbus_error_is_set (error) &&
+             dbus_error_has_name (error, DBUS_ERROR_NO_MEMORY))
+           {
+             return FALSE;
+           }
+         
+

This is OK, but it might be slightly cleaner to move the second
dbus_set_error into the bus_selinux_allows_send function, so the outer
code doesn't need to special-case the NO_MEMORY error.  The same for the
bus/services.c change.

Other than that this patch looks good to me; not a big deal either way.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/dbus/attachments/20050412/f4c67fe9/attachment.pgp


More information about the dbus mailing list