]> git.ipfire.org Git - thirdparty/suricata.git/commit
cppcheck: work around snprintf warning 1937/head
authorVictor Julien <victor@inliniac.net>
Mon, 7 Mar 2016 15:55:09 +0000 (16:55 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 15 Mar 2016 12:30:52 +0000 (13:30 +0100)
commit8394b38941492b7264e26c14b8fa435c859d2497
treed2dfabc742a74fa6c252fe7adc2981dedefb3315
parent33fd710367f492f80fc5f8a532a9f3afc7ab63bd
cppcheck: work around snprintf warning

Cppcheck 1.72 gives a warning on the following code pattern:

    char blah[32] = "";
    snprintf(blah, sizeof(blah), "something");

The warning is:

    (error) Buffer is accessed out of bounds.

While this appears to be a FP, in most cases the initialization to ""
was unnecessary as the snprintf statement immediately follows the
variable declaration.
13 files changed:
src/detect-engine-loader.c
src/detect-engine.c
src/detect.c
src/flow-manager.c
src/log-tcp-data.c
src/output-json-flow.c
src/output-json-netflow.c
src/runmode-unix-socket.c
src/util-classification-config.c
src/util-debug.h
src/util-reference-config.c
src/util-rule-vars.c
src/util-threshold-config.c