-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Coverity fixes #3505
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
Merged
Merged
Coverity fixes #3505
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
common/scancode.c:369
- The removal of the explicit index masking (i.e. index &= 0xff) may lead to unintended behavior when index exceeds 8 bits. Consider verifying if additional masking is necessary to preserve the intended behavior.
// Removed: index &= 0xff;
be834f1
to
86ef491
Compare
Missing break statement in a switch intoduced by commit 54acca4 The results of this are benign, as the extra code which is run is unlikely to do anything.
The datasize variable is an unsigned in, so comparing it to < 0 will never be true. There is also a printf sequence for the variable which should be %u rather than %d
e124cf3
to
dae9c79
Compare
These Coverity warnings all relate to the user of g_setenv() where the return result isn't checked. An additional void function g_setenv_log() is provided which logs failures to set environment variables, and returns no status. This is used in all the places where g_setenv_is currently called.
g_bitmask_to_str() can return < 0 on error. This is not adequately catered for.
Cater for xrdp_mm_get_value() returning NULL in a couple of places. Also:- - The function parse_chansrvport() now checks that passed-in value isn't NULL. - Unnecessary uses of g_strncpy replaced with strlcpy()
Coverity is complaining about 32-bits being truncated to 16-bits. Make the data conversion to unsigned short explicit.
dae9c79
to
d30f5fe
Compare
Fixed a few typos in comments and retested. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Address these Coverity CIDs:-
Comments in the individual commits