Skip to content
New issue

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

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

Already on GitHub? # to your account

panic: interface conversion: interface {} is int64 #403

Closed
manunio opened this issue Dec 26, 2023 · 1 comment
Closed

panic: interface conversion: interface {} is int64 #403

manunio opened this issue Dec 26, 2023 · 1 comment

Comments

@manunio
Copy link
Contributor

manunio commented Dec 26, 2023

Description

Hi, oss-fuzz reported following bug:
ASSERT: interface conversion: interface {} is int64, not map[string]interface {}
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64915 (need an google account to access this and that email must be added to oss-fuzz configuration)

Steps to reproduce

func Test64915(t *testing.T) {
	var v any
	data := "J={D.J=2,D=2,D.K=2"
	_, err := Decode(string(data), &v)
	if err != nil {
		fmt.Println(err)
	}
}
❯ go test -run=Test64915

--- FAIL: Test64915 (0.00s)
panic: interface conversion: interface {} is int64, not map[string]interface {} [recovered]
        panic: interface conversion: interface {} is int64, not map[string]interface {} [recovered]
        panic: interface conversion: interface {} is int64, not map[string]interface {}

goroutine 6 [running]:
testing.tRunner.func1.2({0x5fb120, 0xc00007ec30})
        /home/maxx/.gimme/versions/go1.19.linux.amd64/src/testing/testing.go:1396 +0x24e
testing.tRunner.func1()
        /home/maxx/.gimme/versions/go1.19.linux.amd64/src/testing/testing.go:1399 +0x39f
panic({0x5fb120, 0xc00007ec30})
        /home/maxx/.gimme/versions/go1.19.linux.amd64/src/runtime/panic.go:884 +0x212
github.com/BurntSushi/toml.parse.func1()
        /home/maxx/dev/security/oss-fuzz-projects/burntsushi-toml/parse.go:44 +0x1b6
panic({0x5fb120, 0xc00007ec30})
        /home/maxx/.gimme/versions/go1.19.linux.amd64/src/runtime/panic.go:884 +0x212
github.com/BurntSushi/toml.(*parser).valueInlineTable(0xc000150000, {0x16, {0xc0000201e0, 0x0}, {0x0, 0x0}, {0x1, 0x3, 0x1}}, 0x0)
        /home/maxx/dev/security/oss-fuzz-projects/burntsushi-toml/parse.go:488 +0xe85
github.com/BurntSushi/toml.(*parser).value(0x8120d8?, {0x16, {0xc0000201e0, 0x0}, {0x0, 0x0}, {0x1, 0x3, 0x1}}, 0x0)
        /home/maxx/dev/security/oss-fuzz-projects/burntsushi-toml/parse.go:275 +0x66f
github.com/BurntSushi/toml.(*parser).topLevel(0xc000150000, {0x13, {0xc0000201e0, 0x0}, {0x0, 0x0}, {0x1, 0x0, 0x1}})
        /home/maxx/dev/security/oss-fuzz-projects/burntsushi-toml/parse.go:211 +0xada
github.com/BurntSushi/toml.parse({0xc0000201e0, 0x12})
        /home/maxx/dev/security/oss-fuzz-projects/burntsushi-toml/parse.go:87 +0x513
github.com/BurntSushi/toml.(*Decoder).Decode(0xc000061df0, {0x5e59c0?, 0xc000064a40?})
        /home/maxx/dev/security/oss-fuzz-projects/burntsushi-toml/decode.go:151 +0x48a
github.com/BurntSushi/toml.Decode({0x636f6d, 0x12}, {0x5e59c0, 0xc000064a40})
        /home/maxx/dev/security/oss-fuzz-projects/burntsushi-toml/decode.go:36 +0x115
github.com/BurntSushi/toml.Test64915(0x0?)
        /home/maxx/dev/security/oss-fuzz-projects/burntsushi-toml/decode_test.go:1151 +0x51
testing.tRunner(0xc0001364e0, 0x669f70)
        /home/maxx/.gimme/versions/go1.19.linux.amd64/src/testing/testing.go:1446 +0x10b
created by testing.(*T).Run
        /home/maxx/.gimme/versions/go1.19.linux.amd64/src/testing/testing.go:1493 +0x35f
exit status 2
FAIL    github.com/BurntSushi/toml      0.005s

Tested against 4223137

❯ git rev-parse HEAD
4223137ff1f96bc65e65b11b6deff32052b127bb
arp242 added a commit that referenced this issue Jan 2, 2024
This adds a failing test case for #403.
@arp242 arp242 closed this as completed in 0e879cb Jan 3, 2024
@arp242
Copy link
Collaborator

arp242 commented Jan 3, 2024

Thanks; should be fixed now.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants