mirror of https://github.com/OISF/suricata
netmap: suppress format truncation warning
CC source-netmap.o source-netmap.c: In function ‘NetmapOpen’: source-netmap.c:327:56: error: ‘%s’ directive output may be truncated writing up to 15 bytes into a region of size between 10 and 57 [-Werror=format-truncation=] snprintf(devname, sizeof(devname), "netmap:%s%s%s", ^~ ns->iface, strlen(optstr) ? "/" : "", optstr); ~~~~~~ source-netmap.c:327:9: note: ‘snprintf’ output 8 or more bytes (assuming 70) into a destination of size 64 snprintf(devname, sizeof(devname), "netmap:%s%s%s", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ns->iface, strlen(optstr) ? "/" : "", optstr); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source-netmap.c:330:59: error: ‘%s’ directive output may be truncated writing up to 15 bytes into a region of size between 8 and 55 [-Werror=format-truncation=] snprintf(devname, sizeof(devname), "netmap:%s-%d%s%s", ^~ ns->iface, ring, strlen(optstr) ? "/" : "", optstr); ~~~~~~ source-netmap.c:330:9: note: ‘snprintf’ output 10 or more bytes (assuming 72) into a destination of size 64 snprintf(devname, sizeof(devname), "netmap:%s-%d%s%s", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ns->iface, ring, strlen(optstr) ? "/" : "", optstr); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source-netmap.c:316:54: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=] snprintf(devname, sizeof(devname), "%s}%d%s%s", ^ source-netmap.c:316:9: note: ‘snprintf’ output 3 or more bytes (assuming 65) into a destination of size 64 snprintf(devname, sizeof(devname), "%s}%d%s%s", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ns->iface, ring, strlen(optstr) ? "/" : "", optstr); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Gcc 8 with -Wformat-truncation=1pull/4062/head
parent
bdd74d413b
commit
06d3e1d3d8
Loading…
Reference in New Issue