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

fmt/print: fix cppcheck overflow warning #542

Merged
merged 1 commit into from
Sep 23, 2022
Merged

Conversation

sreimers
Copy link
Member

src/fmt/print.c:77:15: error: Pointer arithmetic overflow; 'buf' buffer size is 64 [ctuPointerArith]
 char c, *p = buf + NUM_SIZE - 1;
              ^
src/fmt/print.c:272:20: note: Calling function local_itoa, 1st argument is uninitialized
   len = local_itoa(num, (sn < 0) ? -sn : sn, base,
                   ^
src/fmt/print.c:77:15: note: Using argument buf
 char c, *p = buf + NUM_SIZE - 1;

```
src/fmt/print.c:77:15: error: Pointer arithmetic overflow; 'buf' buffer size is 64 [ctuPointerArith]
 char c, *p = buf + NUM_SIZE - 1;
              ^
src/fmt/print.c:272:20: note: Calling function local_itoa, 1st argument is uninitialized
   len = local_itoa(num, (sn < 0) ? -sn : sn, base,
                   ^
src/fmt/print.c:77:15: note: Using argument buf
 char c, *p = buf + NUM_SIZE - 1;
```
@sreimers sreimers changed the title fmt/print: fix cppcheck overflow fmt/print: fix cppcheck overflow warning Sep 22, 2022
@sreimers sreimers merged commit 7d69560 into main Sep 23, 2022
@sreimers sreimers deleted the fmt_print_cppcheck branch September 23, 2022 11:04
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