diff options
author | Miloslav Trmač <mitr@redhat.com> | 2013-04-18 20:31:48 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2013-05-06 19:57:03 +0200 |
commit | 8085a29c67c4a6e1f58f8975e0f7426d09d0fa99 (patch) | |
tree | cc666b3b531e9f817cd4a8569fe8a0860c8561c3 /src | |
parent | 25298f4dea7970d7b0f3adefd4b56f7154ae9335 (diff) | |
download | polkit-8085a29c67c4a6e1f58f8975e0f7426d09d0fa99.tar.gz |
Fix handling of null returned from _runRules
https://bugs.freedesktop.org/show_bug.cgi?id=63575
Diffstat (limited to 'src')
-rw-r--r-- | src/polkitbackend/polkitbackendjsauthority.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/polkitbackend/polkitbackendjsauthority.c b/src/polkitbackend/polkitbackendjsauthority.c index 3eeca21..0dd9548 100644 --- a/src/polkitbackend/polkitbackendjsauthority.c +++ b/src/polkitbackend/polkitbackendjsauthority.c @@ -1188,20 +1188,20 @@ polkit_backend_js_authority_check_authorization_sync (PolkitBackendInteractiveAu goto out; } - if (!JSVAL_IS_STRING (rval) && !JSVAL_IS_NULL (rval)) + if (JSVAL_IS_NULL (rval)) { - g_warning ("Expected a string"); + /* this fine, means there was no match, use implicit authorizations */ + good = TRUE; goto out; } - ret_jsstr = JSVAL_TO_STRING (rval); - if (ret_jsstr == NULL) + if (!JSVAL_IS_STRING (rval)) { - /* this fine, means there was no match, use implicit authorizations */ - good = TRUE; + g_warning ("Expected a string"); goto out; } + ret_jsstr = JSVAL_TO_STRING (rval); ret_utf16 = JS_GetStringCharsZ (authority->priv->cx, ret_jsstr); ret_str = g_utf16_to_utf8 (ret_utf16, -1, NULL, NULL, &error); if (ret_str == NULL) |