From 75508cea4a95ea63a1a4c192c82e827a712aa709 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 1 Dec 2010 17:39:30 -0800 Subject: Turns out there are lots of places in S3 where token passed in here can be NULL (become_root() sets the current security token to NULL for example). Ensure we don't crash. Jeremy. Autobuild-User: Jeremy Allison Autobuild-Date: Thu Dec 2 03:26:03 CET 2010 on sn-devel-104 --- libcli/security/privileges.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libcli/security') diff --git a/libcli/security/privileges.c b/libcli/security/privileges.c index 57c485dbe6..e215b5f43a 100644 --- a/libcli/security/privileges.c +++ b/libcli/security/privileges.c @@ -412,6 +412,10 @@ bool security_token_has_privilege(const struct security_token *token, enum sec_p { uint64_t mask; + if (!token) { + return false; + } + mask = sec_privilege_mask(privilege); if (mask == 0) { return false; -- cgit