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

🐛 Fix nil pointer in patch Apply #7040

Merged

Conversation

killianmuldoon
Copy link
Contributor

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)

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 9, 2022
@k8s-ci-robot
Copy link
Contributor

@killianmuldoon: This issue is currently awaiting triage.

If CAPI contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 9, 2022
Signed-off-by: killianmuldoon <[email protected]>
@killianmuldoon killianmuldoon force-pushed the fix/nil-pointer-patch-option branch from 435439d to ab93cc3 Compare August 9, 2022 11:32
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 9, 2022
@killianmuldoon killianmuldoon changed the title Fix nil pointer in patch Pally 🐛 Fix nil pointer in patch Apply Aug 9, 2022
@@ -134,6 +134,9 @@ func (p Patch) Apply(latest Setter, options ...ApplyOption) error {

applyOpt := &applyOptions{}
for _, o := range options {
if util.IsNil(o) {
Copy link
Contributor Author

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.

Copy link
Contributor

@ykakarap ykakarap left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 10, 2022
@sbueringer
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 17, 2022
@k8s-ci-robot k8s-ci-robot merged commit b7e1199 into kubernetes-sigs:main Aug 17, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.3 milestone Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants