-
-
Notifications
You must be signed in to change notification settings - Fork 84
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 warning #1663
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I have reverted to strerror for now, this needs a larger discussion. According to man strerror_r glibc recommends 1024 bytes (because that's what they internally allocate). |
and reset this branch to implement a new solution
…strerror_r() due to GNU / POSIX portability complexity
After discussion on IRC, here is a new fix, that keeps things stupid simple, by just printing the raw errno. Dont use strerror() in thread and dont use strerror_r() due to GNU / POSIX portability complexity. The errno number could be resolved manually in rare case this line is hit. Ready for review again. |
I like the new approach, very reasonable |
Found by: Geo
Patch by: michaelortmann
Fixes:
One-line summary:
Fix format-truncation warning
Additional description (if needed):
This PR truncates the return of
strerror_r()
to a reasonable len. Better, than to raise thedtn->strerror
buffer size, becausestruct dns
is per dns thread, so it should be small in size to avoid any memory bloat.Test cases demonstrating functionality (if applicable):
Fixes: