]> git.ipfire.org Git - thirdparty/suricata.git/commit
detect/pcre: assist code analyzer around pointer logic
authorVictor Julien <vjulien@oisf.net>
Tue, 26 Apr 2022 19:47:37 +0000 (21:47 +0200)
committerVictor Julien <vjulien@oisf.net>
Wed, 27 Apr 2022 10:18:30 +0000 (12:18 +0200)
commit69b8b48b9422279943c083a24e5baf64e1c4aa94
tree2c935cbb35c895f2420fb5533fb423e62dbf670d
parent3bc50df9c3397b9ab06376657c5e8c3467fbc7c5
detect/pcre: assist code analyzer around pointer logic

cppcheck:

src/detect-pcre.c:381:27: warning: Either the condition 'pcap' is redundant or there is overflow in pointer subtraction. [nullPointerArithmeticRedundantCheck]
            cut_capture = MIN((pcap - regexstr), (fcap - regexstr));
                          ^
src/detect-pcre.c:378:18: note: Assuming that condition 'pcap' is not redundant
        else if (pcap && !fcap)
                 ^
src/detect-pcre.c:381:27: note: Null pointer subtraction
            cut_capture = MIN((pcap - regexstr), (fcap - regexstr));
                          ^

Bug: #5291.
src/detect-pcre.c