-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🐛 Fix nil pointer in patch Apply #7040
🐛 Fix nil pointer in patch Apply #7040
Conversation
@killianmuldoon: This issue is currently awaiting triage. If CAPI contributors determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: killianmuldoon <[email protected]>
435439d
to
ab93cc3
Compare
@@ -134,6 +134,9 @@ func (p Patch) Apply(latest Setter, options ...ApplyOption) error { | |||
|
|||
applyOpt := &applyOptions{} | |||
for _, o := range options { | |||
if util.IsNil(o) { |
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.
There's a broader issue here about whether we should have nil checks for every arg to every public function for any type that can be nil.
These are the ones we uncovered because this is where the fuzzer touches, but I'm sure there's many more possible cases. I'll open an issue for this to get opinions.
The upside is it will be safer for consumers, but it's going to be messy in the code.
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.
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbueringer The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: killianmuldoon [email protected]
Fix a nil pointer discovered through fuzzing. This condition is unlikely or impossible to occur in CAPI code, but is possible for consumers of the code.
Part of the broader issue discussed in #6334 (comment)