Created
June 7, 2016 20:09
-
-
Save BrianHicks/b91ae3df24a8332aa78aa51fc9c09380 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"\0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
illegal | |
panic: bytes.Buffer: UnreadRune: previous operation was not ReadRune | |
goroutine 1 [running]: | |
panic(0x1c7fe0, 0xc82000a810) | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/runtime/panic.go:481 +0x3e6 | |
github.com/hashicorp/hcl/hcl/scanner.(*Scanner).unread(0xc82007d110) | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/github.com/hashicorp/hcl/hcl/scanner/scanner.go:106 +0xcd | |
github.com/hashicorp/hcl/hcl/scanner.(*Scanner).scanDigits(0xc82007d110, 0x0, 0x8, 0x2, 0x0) | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/github.com/hashicorp/hcl/hcl/scanner/scanner.go:537 +0x1ad | |
github.com/hashicorp/hcl/hcl/scanner.(*Scanner).scanEscape(0xc82007d110, 0x2200000000) | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/github.com/hashicorp/hcl/hcl/scanner/scanner.go:509 +0x143 | |
github.com/hashicorp/hcl/hcl/scanner.(*Scanner).scanString(0xc82007d110) | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/github.com/hashicorp/hcl/hcl/scanner/scanner.go:493 +0x3c1 | |
github.com/hashicorp/hcl/hcl/scanner.(*Scanner).Scan(0xc82007d110, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/github.com/hashicorp/hcl/hcl/scanner/scanner.go:166 +0x6a8 | |
github.com/hashicorp/hcl/hcl/parser.(*Parser).scan(0xc820041c98, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/github.com/hashicorp/hcl/hcl/parser/parser.go:376 +0x156 | |
github.com/hashicorp/hcl/hcl/parser.(*Parser).objectKey(0xc820041c98, 0x0, 0x0, 0x0, 0x0, 0x0) | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/github.com/hashicorp/hcl/hcl/parser/parser.go:196 +0x122 | |
github.com/hashicorp/hcl/hcl/parser.(*Parser).objectItem(0xc820041c98, 0x0, 0x0, 0x0) | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/github.com/hashicorp/hcl/hcl/parser/parser.go:125 +0xd5 | |
github.com/hashicorp/hcl/hcl/parser.(*Parser).objectList(0xc820041c98, 0x0, 0x0, 0x0) | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/github.com/hashicorp/hcl/hcl/parser/parser.go:70 +0x127 | |
github.com/hashicorp/hcl/hcl/parser.(*Parser).Parse(0xc820041c98, 0xc82007d110, 0x0, 0x0) | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/github.com/hashicorp/hcl/hcl/parser/parser.go:53 +0x166 | |
github.com/hashicorp/hcl/hcl/parser.Parse(0x413000, 0x3, 0x200000, 0x1, 0x0, 0x0) | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/github.com/hashicorp/hcl/hcl/parser/parser.go:40 +0x261 | |
github.com/hashicorp/hcl.parse(0x413000, 0x3, 0x200000, 0x4, 0x0, 0x0) | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/github.com/hashicorp/hcl/parse.go:26 +0xcf | |
github.com/hashicorp/hcl.Unmarshal(0x413000, 0x3, 0x200000, 0x18a1e0, 0xc82002e080, 0x0, 0x0) | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/github.com/hashicorp/hcl/decoder.go:27 +0x7e | |
github.com/BrianHicks/fuzz-hcl.parseSafely(0x413000, 0x3, 0x200000, 0x0, 0x0) | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/github.com/BrianHicks/fuzz-hcl/main.go:23 +0xdb | |
github.com/BrianHicks/fuzz-hcl.Fuzz(0x413000, 0x3, 0x200000, 0x3) | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/github.com/BrianHicks/fuzz-hcl/main.go:7 +0x6c | |
go-fuzz-dep.Main(0x239dc8) | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/go-fuzz-dep/main.go:49 +0x14c | |
main.main() | |
/var/folders/f6/l26tk3xs5pjczcd5k5pcrmk00000gn/T/go-fuzz-build735862163/src/go.fuzz.main/main.go:10 +0x23 | |
exit status 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"\"\\0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fuzzy | |
import "github.com/hashicorp/hcl" | |
// Fuzz does go-fuzz work | |
func Fuzz(data []byte) int { | |
if err := parseSafely(data); err != nil { | |
return 0 | |
} | |
return 1 | |
} | |
func parseSafely(buf []byte) (err error) { | |
out := new(interface{}) | |
return hcl.Unmarshal(buf, &out) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment