Skip to content
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

Covscan fixes #5526

Closed

Conversation

alexey-tikhonov
Copy link
Member

This is overtake of PR #5498 (based on #5498 (comment) comment)

Two patches were taken "as is".
Patch "symlink() expects non-NULL second argument" was slightly amended (different error code used).
One patch was skipped as I either don't understand it or it's not entirely correct.

Covscan is confused by dangling pointers in arrays after freeing. Its
analyzer may decide to visit already visited list elements and since
they weren't NULL-ed, it may consider double-free to happen in the code.

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
covscan does consider 'ret' unitialized even though
GET_ATTR/GET_ATTR_ARRAY macros have explicit and unconditional
assignment to ret. This is confusing but causing actual failures in
covscan runs.

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Author: Alexander Bokovoy <abokovoy@redhat.com>

Amended by: Alexey Tikhonov <atikhono@redhat.com>
(used 'EINVAL' as error code instead of 'ENOMEM')
@alexey-tikhonov
Copy link
Member Author

Those patches were already reviewed by me, but I'm not sure if I can set ACK as I changed one patch a little bit. Second look won't hurt anyway.

covscan: https://cov01.lab.eng.brq.redhat.com/covscanhub/task/208327/log/fixed.err (sorry for internal link)

@pbrezina
Copy link
Member

pbrezina commented Mar 5, 2021

Ack.

@pbrezina pbrezina self-assigned this Mar 5, 2021
@pbrezina
Copy link
Member

pbrezina commented Mar 5, 2021

Pushed PR: #5526

  • master
    • 42c9ca0 - covscan: symlink() expects non-NULL second argument
    • d73f128 - covscan: initialize ret variable before use
    • 32d2aa5 - prompt config: fix covscan errors

@pbrezina pbrezina added Pushed and removed Accepted Ready to push Ready to push labels Mar 5, 2021
@pbrezina pbrezina closed this Mar 5, 2021
@alexey-tikhonov alexey-tikhonov mentioned this pull request Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants