During fuzzing of fuzz_siginit with implicit conversion sanitezers two overflows were found:
detect-bytetest.c:517:49: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 3712985606 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -581981690 (32-bit, signed)
#0 0x55d381fb6658 in DetectBytetestParse /artifacts/suricata/src/detect-bytetest.c:517:49
#1 0x55d381fab528 in DetectBytetestSetup /artifacts/suricata/src/detect-bytetest.c:576:32
#2 0x55d381080ba2 in SigParseOptions /artifacts/suricata/src/detect-parse.c:1124:21
#3 0x55d381074b15 in SigParse /artifacts/suricata/src/detect-parse.c:2222:19
#4 0x55d38106fc64 in SigInitHelper /artifacts/suricata/src/detect-parse.c:3436:11
#5 0x55d381041aec in SigInitDo /artifacts/suricata/src/detect-parse.c:3583:22
#6 0x55d381041708 in SigInit /artifacts/suricata/src/detect-parse.c:3626:12
#7 0x55d381047749 in DetectEngineAppendSig /artifacts/suricata/src/detect-parse.c:3973:22
#8 0x55d38099d188 in LLVMFuzzerTestOneInput /artifacts/suricata/src/tests/fuzz/fuzz_siginit.c:71:26
#9 0x55d380898efb in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /usr/src/RPM/BUILD/llvm-project-20/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:619:13
#10 0x55d380880e3f in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /usr/src/RPM/BUILD/llvm-project-20/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:328:6
#11 0x55d380886fd1 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /usr/src/RPM/BUILD/llvm-project-20/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:863:9
#12 0x55d3808b3162 in main /usr/src/RPM/BUILD/llvm-project-20/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
#13 0x7f8cd11c6c8b (/lib64/libc.so.6+0x27c8b) (BuildId: 169e9c77efa2e23950e429aa9b36a179832d8ae6)
#14 0x7f8cd11c6d44 in __libc_start_main (/lib64/libc.so.6+0x27d44) (BuildId: 169e9c77efa2e23950e429aa9b36a179832d8ae6)
#15 0x55d38087b620 in _start (/artifacts/debug_workdir/fuzz_siginit+0x16b2620) (BuildId: f6513e1b85527de96c6dbbcbd7b49f0b5767080f)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior detect-bytetest.c:517:49
detect-bytejump.c:461:49: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -2147483648 (32-bit, signed)
#0 0x55d75ff1e713 in DetectBytejumpParse /artifacts/suricata/src/detect-bytejump.c:461:49
#1 0x55d75ff13fec in DetectBytejumpSetup /artifacts/suricata/src/detect-bytejump.c:516:12
#2 0x55d75f024ba2 in SigParseOptions /artifacts/suricata/src/detect-parse.c:1124:21
#3 0x55d75f018b15 in SigParse /artifacts/suricata/src/detect-parse.c:2222:19
#4 0x55d75f013c64 in SigInitHelper /artifacts/suricata/src/detect-parse.c:3436:11
#5 0x55d75efe5aec in SigInitDo /artifacts/suricata/src/detect-parse.c:3583:22
#6 0x55d75efe5708 in SigInit /artifacts/suricata/src/detect-parse.c:3626:12
#7 0x55d75efeb749 in DetectEngineAppendSig /artifacts/suricata/src/detect-parse.c:3973:22
#8 0x55d75e941188 in LLVMFuzzerTestOneInput /artifacts/suricata/src/tests/fuzz/fuzz_siginit.c:71:26
#9 0x55d75e83cefb in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /usr/src/RPM/BUILD/llvm-project-20/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:619:13
#10 0x55d75e824e3f in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /usr/src/RPM/BUILD/llvm-project-20/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:328:6
#11 0x55d75e82afd1 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /usr/src/RPM/BUILD/llvm-project-20/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:863:9
#12 0x55d75e857162 in main /usr/src/RPM/BUILD/llvm-project-20/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
#13 0x7f7fc8227c8b (/lib64/libc.so.6+0x27c8b) (BuildId: 169e9c77efa2e23950e429aa9b36a179832d8ae6)
#14 0x7f7fc8227d44 in __libc_start_main (/lib64/libc.so.6+0x27d44) (BuildId: 169e9c77efa2e23950e429aa9b36a179832d8ae6)
#15 0x55d75e81f620 in _start (/artifacts/debug_workdir/fuzz_siginit+0x16b2620) (BuildId: d1cbd5fc26e48502405732a791ba56806542501e)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior detect-bytejump.c:461:49
This is a minor issue since nbytes is strictly validated to be within the [0, 23] range. Nevertheless, I'd suggest making the type of nbytes consistent and using a smaller one to reduce memory usage.