summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2011-06-29 21:53:33 +0100
committerMartin Pitt <martin.pitt@ubuntu.com>2011-06-29 21:53:33 +0100
commit675e4337d7f83ffaf9612cadf7f365c545c51243 (patch)
tree1c048e5d38e328c65f1813386a6836d6ff1e232b
parent7c5905255763e75ca6350c6b9eac2cbd62558756 (diff)
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.
-rw-r--r--src/polkitbackend/polkitbackendinteractiveauthority.c9
1 files changed, 6 insertions, 3 deletions
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");