gcc 7.1.1 complains:
exthdr.c:41:31: warning: ā%dā directive output may be truncated writing between 1 and 8 bytes into a region of size 3 [-Wformat-truncation=]
snprintf(buf, sizeof buf, "%d", offset);
^~
This warning is incorrect, as offset is limited by tcp option ranges,
but gcc doesn't know this. Increase buffer to avoid the warning.
Signed-off-by: Florian Westphal <fw@strlen.de>
* multiplicator
*/
unsigned int offset = expr->exthdr.offset / 64;
- char buf[3] = {0};
+ char buf[9] = {0};
if (expr->exthdr.flags & NFT_EXTHDR_F_PRESENT) {
printf("tcp option %s", expr->exthdr.desc->name);