Skip to content

[v2] Fix panic in ExtractIntoStructPtr#3287

Merged
mandre merged 1 commit intov2from
bp-v2-571d3f5
Feb 3, 2025
Merged

[v2] Fix panic in ExtractIntoStructPtr#3287
mandre merged 1 commit intov2from
bp-v2-571d3f5

Conversation

@gophercloud-backport-bot
Copy link
Copy Markdown

Backport: #2873

Passing nil as an argument to 'ExtractIntoStructPtr' causes "panic: runtime error: invalid memory address or nil pointer dereference". This is an invalid argument and should be corrected to return an error. For reference, standard package functions such as 'json.Unmarshal' return an error instead of panic.

Fixes #2872

Passing nil as an argument to 'ExtractIntoStructPtr' or
'ExtractIntoSlicePtr' causes "panic: runtime error:
invalid memory address or nil pointer dereference".
This is an invalid argument and should be corrected to
return an error. For reference, standard package functions
such as 'json.Unmarshal' return an error instead of panic.

Signed-off-by: Nobuhiro MIKI <nob@bobuhiro11.net>
Co-authored-by: pýrus <kayrus@users.noreply.github.com>
@github-actions github-actions bot added v2 This PR targets v2 edit:gophercloud This PR updates common Gophercloud code labels Jan 30, 2025
@github-actions github-actions bot added the semver:patch No API change label Jan 30, 2025
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 78.735% (+0.05%) from 78.689%
when pulling c101370 on bp-v2-571d3f5
into 776ad36 on v2.

@mandre mandre merged commit ae26b50 into v2 Feb 3, 2025
@mandre mandre deleted the bp-v2-571d3f5 branch February 3, 2025 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

edit:gophercloud This PR updates common Gophercloud code semver:patch No API change v2 This PR targets v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants