From 675e4337d7f83ffaf9612cadf7f365c545c51243 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 29 Jun 2011 21:53:33 +0100 Subject: Fix backend crash if a .policy file does not specify get_localized_data_for_challenge() would call expand_properties() with a NULL "message" argument, causing a segfault. --- src/polkitbackend/polkitbackendinteractiveauthority.c | 9 ++++++--- 1 file 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"); -- cgit v1.2.3