In a TagAllocSample section, eventually a uintvar of arbitrarily large value is read and then makeslice() fails with size out of range:
panic: runtime error: makeslice: len out of range
goroutine 1 [running]:
runtime.panic(0x5444c0, 0x6f2880)
/usr/local/go/src/pkg/runtime/panic.c:266 +0xb6
github.com/randall77/hprof/read.readNBytes(0x7f170b026088, 0xc210036270, 0x7f868c0ea6d8, 0xa, 0x0, ...)
/dev/go/src/github.com/randall77/hprof/read/parser.go:407 +0x40
github.com/randall77/hprof/read.readBytes(0x7f170b026088, 0xc210036270, 0x2, 0xa, 0x0)
/dev/go/src/github.com/randall77/hprof/read/parser.go:417 +0x53
github.com/randall77/hprof/read.readString(0x7f170b026088, 0xc210036270, 0xc210000660, 0x2)
/dev/go/src/github.com/randall77/hprof/read/parser.go:421 +0x3a
github.com/randall77/hprof/read.rawRead(0x7fff3baae7bd, 0x7, 0x42fec9)
/dev/go/src/github.com/randall77/hprof/read/parser.go:713 +0x4242
github.com/randall77/hprof/read.Read(0x7fff3baae7bd, 0x7, 0x56c840, 0x0, 0xc21000a5a0)
/dev/go/src/github.com/randall77/hprof/read/parser.go:1575 +0x31
main.main()
/dev/go/src/github.com/randall77/hprof/dumptohprof/main.go:105 +0x8e
In a TagAllocSample section, eventually a uintvar of arbitrarily large value is read and then makeslice() fails with size out of range: