Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix format truncation #1779

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

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

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.

1 participant