Fix potential nil pointer dereference in RawRequestWithContext#31979
Fix potential nil pointer dereference in RawRequestWithContext#31979vigneshakaviki wants to merge 1 commit into
Conversation
Move result.Error() check inside the nil validation block to prevent calling Error() on a nil response object. This prevents a panic when the response is nil but an error check is still attempted. Fixes: hashicorp#30209
|
Someone is attempting to deploy a commit to the HashiCorp Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes Test User seems not to be a GitHub user. Have you signed the CLA already but the status is still pending? Recheck it. |
1 similar comment
|
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes Test User seems not to be a GitHub user. Have you signed the CLA already but the status is still pending? Recheck it. |
|
Please make sure to sign the CLA, and that all your commits are associated with the GitHub account you signed the CLA with! :) Thanks! |
Fixes a potential nil pointer dereference where result.Error() is called without verifying result is non-nil first.
The code checks if result != nil for callbacks, but then calls result.Error() outside that block. This allows the Error() call when result is nil, causing a panic.
Fix: Move the result.Error() check inside the nil validation block.
Fixes #30209