]> git.ipfire.org Git - thirdparty/suricata.git/commit
mpm/ac: work around scan-build warnings
authorVictor Julien <vjulien@oisf.net>
Fri, 21 Apr 2023 09:13:19 +0000 (11:13 +0200)
committerVictor Julien <vjulien@oisf.net>
Tue, 25 Apr 2023 09:36:37 +0000 (11:36 +0200)
commit763833c217835ede1fa5352df3059b1df67d9237
tree10a836e6c1500a54cb1ec4476326e656e3d46913
parent77e60e3368e5a73e1f0855a228f6a07473c3e6ab
mpm/ac: work around scan-build warnings

util-mpm-ac.c:531:32: warning: Result of 'malloc' is converted to a pointer of type 'uint16_t[256]', which is incompatible with sizeof operand type 'uint16_t' [unix.MallocSizeof]
        ctx->state_table_u16 = SCMalloc(ctx->state_count *
                               ^~~~~~~~
./util-mem.h:35:18: note: expanded from macro 'SCMalloc'
 #define SCMalloc malloc
                 ^~~~~~
util-mpm-ac.c:575:32: warning: Result of 'malloc' is converted to a pointer of type 'uint32_t[256]', which is incompatible with sizeof operand type 'uint32_t' [unix.MallocSizeof]
        ctx->state_table_u32 = SCMalloc(ctx->state_count *
                               ^~~~~~~~
./util-mem.h:35:18: note: expanded from macro 'SCMalloc'
 #define SCMalloc malloc
                 ^~~~~~
2 warnings generated.

Bug: #3148.
(cherry picked from commit ee683a7074d449b5b2b272e70f86caa20b230662)
src/util-mpm-ac.c