]> Cypherpunks repositories - gostls13.git/commit
cmd/objdump: guard against out-of-range lines from directives.
authorDavid Chase <drchase@google.com>
Wed, 11 Mar 2020 17:36:42 +0000 (13:36 -0400)
committerDavid Chase <drchase@google.com>
Thu, 12 Mar 2020 20:40:54 +0000 (20:40 +0000)
commit29b36a88ab0b179c140612e7c907042b2a388587
treef7cff4218c96143ba7f1b98c827db3f6ac321117
parente221a75deab7843d5414154000f5bea7abcb60c3
cmd/objdump: guard against out-of-range lines from directives.

//line bogo.go:9999999 will cause 'go tool objdump' to crash
unless bogo.go has that many lines.  Guard the array index
and return innocuous values (nil, nil) from the file cache.

Fixes #36683

Change-Id: I4a9f8444dc611654d270cc876e8848dfd2f84770
Reviewed-on: https://go-review.googlesource.com/c/go/+/223081
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/internal/objfile/disasm.go
src/cmd/objdump/objdump_test.go
src/cmd/objdump/testdata/fmthello.go
test/run.go