-
Notifications
You must be signed in to change notification settings - Fork 268
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 string truncation warnings related to PATH_MAX #1244
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1244 +/- ##
==========================================
+ Coverage 51.02% 51.11% +0.09%
==========================================
Files 45 45
Lines 18214 18251 +37
==========================================
+ Hits 9293 9329 +36
- Misses 8921 8922 +1 ☔ View full report in Codecov by Sentry. |
Concerning Windows, MSYS2 MinGW-w64 provides And for the MSVC builds (librrd-8.vcxproj) there are: |
the build-test-linux does run valgrind ... not sure if the tests are hitting path areas ... maybe have a look? this is how to run the tests on the commandline
|
And there is whole printf implementation so there should not be a problem with any platform lacking asprinf. Yes, I see that the tests run valgrind, and the coverage tool points out that some of the error cases are not tested. |
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.
please add to the CHANGES file!
There are a number of places where rrdtool combines multiple PATH_MAX sized strings into one. PATH_MAX is a constant that tends to work in practice a lot of the time but may not reflect the real capabilities of the system in real time. In place of on-stack buffers of PATH_MAX size allocate memory dynamically. Initialize the pointers to NULL so they can be all freed unconditionally on exit. Fixes: oetiker#1223 Signed-off-by: Michal Suchanek <[email protected]>
There are a number of places where rrdtool combines multiple PATH_MAX sized strings into one.
PATH_MAX is a constant that tends to work in practice a lot of the time but may not reflect the real capabilities of the system in real time.
In place of on-stack buffers of PATH_MAX size allocate memory dynamically. Initialize the pointers to NULL so they can be all freed unconditionally on exit.
Fixes: #1223
Note: this is not tested, and the changes are substantial. If this looks like a generally good way to do it it warrants running the code with valgrind or similar.
Also it is not clear that asprintf implementation is needed. configure tests for asprintf presence but a windows implementation is provided.