]> 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>
Mon, 24 Apr 2023 05:17:22 +0000 (07:17 +0200)
commitee683a7074d449b5b2b272e70f86caa20b230662
treec8eeb7f1d904f856b7ec2defbed085ce9aabfad5
parentec84ba1a3c981108af4613fa16d5f13cc19e1f1d
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.
src/util-mpm-ac.c