Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic on invalid input #479

Closed
abrander opened this issue Oct 27, 2024 · 2 comments
Closed

Panic on invalid input #479

abrander opened this issue Oct 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@abrander
Copy link

Describe the bug

go-yaml panics on invalid input.

To Reproduce

package main

import "github.com/goccy/go-yaml"

func main() {
	target := make(map[string]any)

	yaml.Unmarshal([]byte("0::"), &target)
}

Playground link: https://go.dev/play/p/55WKa4zscyX

Expected behavior

I expected Unmarshal to return an error and not panic.

Version Variables

  • Go version: go1.23.2
  • go-yaml's Version: v1.12.0
@abrander abrander added the bug Something isn't working label Oct 27, 2024
@semihbkgr
Copy link
Contributor

Hi @abrander, I created a new issue that explains the cause of this panic you encountered.

@abrander
Copy link
Author

I can confirm this is solved by #485. Thanks, @semihbkgr, you're moving fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants