mirror of https://github.com/OISF/suricata
detect/port: address format truncation warnings
This appears to be a FP. Work around it to allow for using this warning
as an error.
detect-engine-port.c: In function 'DetectPortParseDo':
detect-engine-port.c:858:35: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=]
858 | "[%s]", rule_var_port);
| ^
detect-engine-port.c:857:21: note: 'snprintf' output 3 or more bytes (assuming 4) into a destination of size 3
857 | snprintf(alloc_rule_var_port, strlen(rule_var_port) + 3,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
858 | "[%s]", rule_var_port);
| ~~~~~~~~~~~~~~~~~~~~~~
detect-engine-port.c:928:34: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=]
928 | "[%s]", rule_var_port);
| ^
detect-engine-port.c:927:21: note: 'snprintf' output 3 or more bytes (assuming 4) into a destination of size 3
927 | snprintf(alloc_rule_var_port, strlen(rule_var_port) + 3,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
928 | "[%s]", rule_var_port);
| ~~~~~~~~~~~~~~~~~~~~~~
Ticket: #7905.
pull/13926/head
parent
5564838c22
commit
3d0d7b740e
Loading…
Reference in New Issue