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

Static analysis coverity fixes #13

Merged
merged 3 commits into from
Aug 21, 2024
Merged

Conversation

priyankar-jain
Copy link
Collaborator

@priyankar-jain priyankar-jain commented Aug 20, 2024

Fixes includes:

  1. Explicit initialise variables before use.
  2. NULL checks for pointers before use.
  3. Missing deallocations.
  4. Changed time(NULL) to timespec to avoid int overflow.
  5. Fixed few printfs/LOG.
  6. Fix for TOCTOU: Use mkdir directly and check for errno instead of
    using stat and then mkdir.
  7. Added explicit break statements in switch case.
  8. int to enum explicit type casting.

Fixes includes:
1. Explicit initialise variables before use.
2. NULL checks for pointers before use.
3. Missing deallocations.
4. Changed time(NULL) to timespec to avoid int overflow.
5. Fixed few printfs/LOG.

Signed-off-by: Priyankar Jain <[email protected]>
@priyankar-jain priyankar-jain requested a review from jlevon August 20, 2024 14:40
1. Fix for TOCTOU: Use mkdir directly and check for errno instead of
   using stat and then mkdir.
2. Added explicit break statements in switch case.
3. int to enum explicit type casting.

Signed-off-by: Priyankar Jain <[email protected]>
Copy link

@mansish404 mansish404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks!

@priyankar-jain priyankar-jain merged commit ba199c9 into master Aug 21, 2024
2 checks passed
@priyankar-jain priyankar-jain deleted the priyankar/coverity_fixes branch August 21, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants