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

Check for nil pointer in the sources client #340

Merged

Conversation

dehort
Copy link
Contributor

@dehort dehort commented Feb 20, 2024

What?

Its possible that the generated sources client can return a nil error and a nil pointer to the data. When this happens, the code attempts to dereferrence the nil pointer...which causes a panic. The web framework handles the panic and returns a 500 error.

RHCLOUD-31105

Why?

Consider what business or engineering goal does this PR achieves.

How?

Added more checks for nil pointers.

Testing

More tests were added to the sources client.

Anything Else?

Any other notes about the PR that would be useful for the reviewer.

Secure Coding Practices Checklist Link

Secure Coding Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

@dehort dehort changed the title Check for nil pointer in the sources client WIP: Check for nil pointer in the sources client Feb 27, 2024
@dehort dehort force-pushed the check_for_nil_pointer_rhcloud-31105 branch from 601361c to 02b7b55 Compare March 4, 2024 16:11
@dehort dehort changed the title WIP: Check for nil pointer in the sources client Check for nil pointer in the sources client Mar 4, 2024
Copy link
Contributor

@justinorringer justinorringer left a comment

Choose a reason for hiding this comment

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

Looking good!

Copy link
Member

@tahmidefaz tahmidefaz left a comment

Choose a reason for hiding this comment

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

lgtm!

@dehort
Copy link
Contributor Author

dehort commented Mar 4, 2024

/retest

@dehort dehort force-pushed the check_for_nil_pointer_rhcloud-31105 branch from 0a57c11 to 85f10f5 Compare March 4, 2024 22:06
@dehort dehort merged commit a74edfa into RedHatInsights:master Mar 5, 2024
12 of 14 checks passed
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.

3 participants