]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/lib: Fix Access to field results in dereference of NULL pointer
authorNoel Power <noel.power@suse.com>
Wed, 3 Jul 2019 12:45:56 +0000 (12:45 +0000)
committerNoel Power <npower@samba.org>
Mon, 8 Jul 2019 09:30:10 +0000 (09:30 +0000)
Fixes:

ource3/lib/messages_dgm.c:176:29: warning: Access to field 'queue' results in a dereference of a null pointer (loaded from variable 'out') <--[clang]
        qlen = tevent_queue_length(out->queue);

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source3/lib/messages_dgm.c

index 60a12e2008fa8c5871dd80eefe5f7ced533634b6..11cb6969e733a1bdaac6a54d209dd02bbe1cac92 100644 (file)
@@ -323,6 +323,13 @@ static int messaging_dgm_out_get(struct messaging_dgm_context *ctx, pid_t pid,
        }
 
        messaging_dgm_out_rearm_idle_timer(out);
+       /*
+        * shouldn't be possible, should be set if messaging_dgm_out_create
+        * succeeded. This check is to satisfy static checker
+        */
+       if (out == NULL) {
+               return EINVAL;
+       }
 
        *pout = out;
        return 0;