mirror of https://github.com/OISF/suricata
detect/mpm: address format truncation warnings
detect-engine-mpm.c: In function ‘BuildBasicPname’:
detect-engine-mpm.c:197:43: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
197 | snprintf(pname, sizeof(pname), "%s", name);
| ^
detect-engine-mpm.c:197:9: note: ‘snprintf’ output 1 or more bytes (assuming 2) into a destination of size 1
197 | snprintf(pname, sizeof(pname), "%s", name);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
detect-engine-mpm.c: In function ‘AppendTransformsToPname’:
detect-engine-mpm.c:231:61: error: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 7 [-Werror=format-truncation=]
231 | snprintf(xforms_print, sizeof(xforms_print), " (%s)", xforms);
| ^~ ~~~~~~
detect-engine-mpm.c:231:13: note: ‘snprintf’ output between 4 and 1027 bytes into a destination of size 9
231 | snprintf(xforms_print, sizeof(xforms_print), " (%s)", xforms);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ticket: #7905.
pull/13926/head
parent
103bad19bb
commit
5564838c22
Loading…
Reference in New Issue