eggdrop
eggdrop copied to clipboard
Fix format truncation
Found by: michaelortmann Patch by: michaelortmann Fixes:
One-line summary: Fix format truncation
Additional description (if needed):
Found with gcc -Wformat-truncation=2:
gcc -std=gnu99 -Wformat-truncation=2 -pipe -Wall -I.. -I.. -DHAVE_CONFIG_H -I/usr/include -c dcc.c
dcc.c: In function ‘dcc_bot_check_digest’:
dcc.c:613:39: warning: ‘@’ directive output may be truncated writing 1 byte into a region of size between 0 and 30 -Wformat-truncation=]
613 | snprintf(digest_string, 33, "<%lx%lx@", (long) getpid(),
| ^
dcc.c:613:3: note: ‘snprintf’ output between 5 and 35 bytes into a destination of size 33
613 | snprintf(digest_string, 33, "<%lx%lx@", (long) getpid(),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
614 | (unsigned long) dcc[idx].timeval);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test cases demonstrating functionality (if applicable):