-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fixed coverity issues in acl_program.cpp #228
Merged
Merged
Conversation
This file contains 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
zibaiwan
reviewed
Jan 10, 2023
zibaiwan
requested changes
Jan 14, 2023
haoxian2
force-pushed
the
coverity-acl-program
branch
from
January 17, 2023 21:06
42c4afd
to
6ae25c9
Compare
zibaiwan
reviewed
Jan 18, 2023
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.
Thanks @haoxian2! Looks good to me, can you please fix the clang format, then we can merge this!
zibaiwan
previously approved these changes
Jan 18, 2023
haoxian2
force-pushed
the
coverity-acl-program
branch
from
January 18, 2023 21:33
6ae25c9
to
c05d279
Compare
haoxian2
force-pushed
the
coverity-acl-program
branch
from
January 18, 2023 21:40
69cb093
to
af9910e
Compare
zibaiwan
approved these changes
Jan 19, 2023
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.
Thanks @haoxian2 !
# for free
to join this conversation on GitHub.
Already have an account?
# 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.
Fixed coverity in acl_program.cpp: Dead default in switch (DEADCODE)
(line 256) Default branch never reached since
switch (pass)
only has 0 and 1 as values becausepass
is defined in a for-loop (line 225) as< 2
.Fixed coverity in acl_program.cpp: Dereference before null check (REVERSE_INULL)
(line 145) Program is already dereferenced in the for-loop above to check
program->num_devices
, so the check would also pass.Fixed coverity in acl_program.cpp: Use after free (USE_AFTER_FREE)
(line 1834) Coverity complains that you should not print the pointer address value if it has already been freed. Since we are not accessing what's in the pointer itself, it is safe to query about pointer address value. Therefore, instead of passing the pointer as the argument, a dereferenced pointer to that pointer is passed as an argument instead.