]> git.ipfire.org Git - thirdparty/suricata.git/commit
detect-bytetest: remove meaningless NULL check on data_offset
authorBoris Tonofa <b.tonofa@ideco.ru>
Mon, 30 Jun 2025 13:39:47 +0000 (16:39 +0300)
committerVictor Julien <victor@inliniac.net>
Wed, 2 Jul 2025 06:41:40 +0000 (08:41 +0200)
commit66e7437befe5bff9b7a1d6246b01c8ff76252901
treee688e880162857285e284506c1f1018f617157f0
parent1940454a6991fcf927373a12a94ad8db6494c262
detect-bytetest: remove meaningless NULL check on data_offset

The condition data_offset == NULL can never be true: data_offset has
already been validated as non-NULL a few lines earlier. The guard seems
to have been intended for the offset argument, yet throughout the
codebase offset is never passed as NULL. (In the unit tests, offset is
NULL, but those tests pass the value parameter as NULL, which causes the
function to return before offset is dereferenced.)

Remove the pointless check to simplify control flow and silence
static-analysis warnings.

No functional change.

Bug 7767
src/detect-bytetest.c