Skip to content

fix possible nil pointer dereference in providerCallback#360

Open
EvanDorsky wants to merge 1 commit into
microsoft:mainfrom
EvanDorsky:provider-callback-nilcheck
Open

fix possible nil pointer dereference in providerCallback#360
EvanDorsky wants to merge 1 commit into
microsoft:mainfrom
EvanDorsky:provider-callback-nilcheck

Conversation

@EvanDorsky

Copy link
Copy Markdown

It is possible to hit a nil pointer dereference in providerCallback if a notification fires after go-winio has already stopped tracking the provider - provider will come back nil from providers.getProvider and then any access in the switch (like provider.enabled = false) will panic.

Seemed simple to fix by just wrapping the entire callback in a nil check, I hope this is helpful!

@EvanDorsky
EvanDorsky requested a review from a team as a code owner June 11, 2026 17:52
Signed-off-by: Evan Dorsky <evan.dorsky@icloud.com>
@EvanDorsky
EvanDorsky force-pushed the provider-callback-nilcheck branch from d98b815 to c11364d Compare July 8, 2026 18:38
@EvanDorsky

Copy link
Copy Markdown
Author

I agree with the Contributor License Agreement on behalf of my employer.

@microsoft-github-policy-service agree company="Viam"

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.

1 participant