]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
nsswitch wbinfo: fix uninitialised return value on error
authorGary Lockyer <gary@catalyst.net.nz>
Wed, 21 May 2025 22:32:50 +0000 (10:32 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 28 May 2025 23:04:38 +0000 (23:04 +0000)
In wbinfo_lookup_sids ret was not initialised and was not set in
the error return paths. Returning an uninitialised value in the
event of an error, and in all probability something that evaluated to
true, so would not have signalled the error to the caller.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
nsswitch/wbinfo.c

index 93caa96f66cb6f0a3910fa1568c94784052a1e98..1b3fb41b2d87ba59a88609cce82bddcb8d7f9716 100644 (file)
@@ -1519,7 +1519,7 @@ static bool wbinfo_lookup_sids(const char *arg)
        int i, num_sids;
        const char *p;
        wbcErr wbc_status;
-       bool ret;
+       bool ret = false;
 
        num_sids = 0;
        sids = NULL;