]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib:util: Remove always‐false comparison (CID 242193)
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Fri, 6 Oct 2023 02:27:18 +0000 (15:27 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 13 Oct 2023 02:18:31 +0000 (02:18 +0000)
‘id’ is an unsigned variable, and so it can never be less than zero.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/util/idtree.c

index d72ddfbc53809a8ed2b7bed085df75db99d9cc94..7f08b42947dfc0bc9c25a25a9164791b110a6dcb 100644 (file)
@@ -150,7 +150,7 @@ restart:
                        sh = IDR_BITS*l;
                        id = ((id >> sh) ^ n ^ m) << sh;
                }
-               if ((id >= MAX_ID_BIT) || (id < 0))
+               if (id >= MAX_ID_BIT)
                        return -1;
                if (l == 0)
                        break;