]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
g_lock: Fix uninitalized variable reads
authorVolker Lendecke <vl@samba.org>
Wed, 3 Mar 2021 18:15:31 +0000 (19:15 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 5 Mar 2021 11:22:07 +0000 (11:22 +0000)
If dbwrap_watched_watch_recv() returns IO_TIMEOUT, "blockerdead" might
be an uninitialized non-false, and further down we'll remove the wrong
exclusive locker.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14636
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Mar  5 11:22:07 UTC 2021 on sn-devel-184

source3/lib/g_lock.c

index c36539393e1b85edf441bb3329510f9f7be202e4..36b527706da9694ff2a40e20ae49329400806f46 100644 (file)
@@ -646,8 +646,8 @@ static void g_lock_lock_retry(struct tevent_req *subreq)
        struct g_lock_lock_state *state = tevent_req_data(
                req, struct g_lock_lock_state);
        struct g_lock_lock_fn_state fn_state;
-       struct server_id blocker;
-       bool blockerdead;
+       struct server_id blocker = { .pid = 0 };
+       bool blockerdead = false;
        NTSTATUS status;
 
        status = dbwrap_watched_watch_recv(subreq, &blockerdead, &blocker);