Skip to content

Fix potential nil pointer dereference in RawRequestWithContext#31979

Open
vigneshakaviki wants to merge 1 commit into
hashicorp:mainfrom
vigneshakaviki:fix-nil-deref
Open

Fix potential nil pointer dereference in RawRequestWithContext#31979
vigneshakaviki wants to merge 1 commit into
hashicorp:mainfrom
vigneshakaviki:fix-nil-deref

Conversation

@vigneshakaviki

Copy link
Copy Markdown

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

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
@vigneshakaviki
vigneshakaviki requested a review from a team as a code owner June 3, 2026 02:40
@vigneshakaviki
vigneshakaviki requested a review from Balaji2198 June 3, 2026 02:40
@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the HashiCorp Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Used to indicate a potential bug core/client labels Jun 3, 2026
@hashicorp-cla-app

Copy link
Copy Markdown

CLA assistant check

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.
You need a GitHub account to be able to sign the CLA.
If you have already a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

1 similar comment
@hashicorp-cla-app

Copy link
Copy Markdown

CLA assistant check

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.
You need a GitHub account to be able to sign the CLA.
If you have already a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

@heatherezell

Copy link
Copy Markdown
Contributor

Please make sure to sign the CLA, and that all your commits are associated with the GitHub account you signed the CLA with! :) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Used to indicate a potential bug core/client size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

api /client.go possible dereference of a null pointer

2 participants