Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Fix possible panic when using ComposeDecodeHookFunc() with no funcs #251

Conversation

eh-steve
Copy link

@eh-steve eh-steve commented Jul 9, 2021

On < v1.3.3, ComposeDecodeHookFunc() was safe to use with no args, but since decea91 (v1.4.1) it can cause a panic due to it accidentally replacing the input with an untyped nil after the nil check on L405

if input == nil {

This PR restores the previous behaviour with minimal impact to allow easier upgrades

@mitchellh
Copy link
Owner

Thanks this looks pretty good, I think it'd be easier to initialize data to f from the beginning it looks like.

@mitchellh mitchellh merged commit 6577afa into mitchellh:master Sep 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants