chansrv-fuse Fix cppcheck 1.89+1.90 warnings #1481
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses the cppcheck warning generated by cppcheck for
xrdp/xrdp_{xfs,fuse}.c
anddevredir.c
mentioned in #1473The warning in
chansrv_fuse.c
generated by cppcheck 1.90 (but not 1.89 or 1.82) appears to be a regression in cppcheck which has already been reported - see cppcheck TRAC 9292 and 9437. Following arealloc()
failure, afree()
of the original region results in a false positive.cppcheck allows for false positives to be flagged with specially formed comments. The
--inline-suppr
command-line flag is needed to enable these. This approach has been taken for this file.The warning in
devredir.c
appears to be valid code used to generate a random number if/dev/urandom
is unavailable. I've simply replaced the code with a call tog_random()
in this case.So despite the warnings, no actual bugs have been found here.
Update: After #1487 was merged, the warning which had previously been generated for
chansrv_xfs.c
has now gone. This file has been removed from the original PR.