]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib/fuzzing:fuzz_sddl_access_check fix nul-term check
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sat, 5 Aug 2023 02:18:46 +0000 (14:18 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 8 Aug 2023 04:39:38 +0000 (04:39 +0000)
We were wanting to ensure the string contains a zero byte, but
instead were checking for a non-zero byte.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/fuzzing/fuzz_sddl_access_check.c

index 0c936efdba6520acdddc469f95f4b9f8d0a44138..3d9ebdc61116b626d2c2542997333f813b9e240c 100644 (file)
@@ -103,7 +103,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *input, size_t len)
         * all.
         */
        for (i = len - 1; i >= 0; i--) {
-               if (input[i] != 0) {
+               if (input[i] == 0) {
                        break;
                }
        }