PolicyKit: Branch 'master'

Martin Pitt martin at kemper.freedesktop.org
Wed Jun 29 13:54:28 PDT 2011


 src/polkitbackend/polkitbackendinteractiveauthority.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 675e4337d7f83ffaf9612cadf7f365c545c51243
Author: Martin Pitt <martin.pitt at ubuntu.com>
Date:   Wed Jun 29 21:53:33 2011 +0100

    Fix backend crash if a .policy file does not specify <message>
    
    get_localized_data_for_challenge() would call expand_properties() with a NULL
    "message" argument, causing a segfault.

diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
index 4100f87..8b32459 100644
--- a/src/polkitbackend/polkitbackendinteractiveauthority.c
+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
@@ -1834,9 +1834,12 @@ get_localized_data_for_challenge (PolkitBackendInteractiveAuthority *authority,
     }
 
   /* replace $(property) with values */
-  s = message;
-  message = expand_properties (message, details, authority, action_id);
-  g_free (s);
+  if (message != NULL)
+    {
+      s = message;
+      message = expand_properties (message, details, authority, action_id);
+      g_free (s);
+    }
 
   /* Back to C! */
   setlocale (LC_ALL, "C");


More information about the hal-commit mailing list