Skip to content

Conversation

@michaelortmann
Copy link
Member

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):

@vanosg vanosg added this to the v1.10.2 milestone Dec 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants