Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Fix gosec warnings #224

Merged
merged 5 commits into from
Jun 1, 2023
Merged

Conversation

thepetk
Copy link
Collaborator

@thepetk thepetk commented May 26, 2023

What does this PR do?

Fixes several warnings from gosec security check:

  • Potential file inclusion: It fixes the issue by using the filepath.Clean() func before using the os.Open() func.
  • Defering unsafe method: Adds error handling cases inside defer funcs used for file.Close() funcs.
  • Errors unhandled: For each Unmarshal() func used without error handling, it adds the appropriate error handling.

Which issue(s) does this PR fix

Fixes #222

PR acceptance criteria

Testing and documentation do not need to be complete in order for this PR to be approved. We just need to ensure tracking issues are opened.

  • Unit/Functional tests

  • Documentation

How to test changes / Special notes to the reviewer

@thepetk thepetk requested a review from mike-hoang May 26, 2023 11:37
@thepetk thepetk self-assigned this May 26, 2023
@thepetk thepetk mentioned this pull request May 31, 2023
Signed-off-by: thepetk <thepetk@gmail.com>
Signed-off-by: thepetk <thepetk@gmail.com>
Signed-off-by: thepetk <thepetk@gmail.com>
Signed-off-by: thepetk <thepetk@gmail.com>
Signed-off-by: thepetk <thepetk@gmail.com>
@thepetk thepetk merged commit 58927f6 into redhat-developer:main Jun 1, 2023
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix gosec warnings
2 participants