]> Cypherpunks repositories - gostls13.git/commit
cmd/pack: fix export data truncation bug
authorMatthew Dempsky <mdempsky@google.com>
Thu, 31 Aug 2017 18:26:28 +0000 (11:26 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Sat, 9 Sep 2017 14:13:33 +0000 (14:13 +0000)
commit3d7042fba341180e63ea27fdfafbbab2499314aa
treed37d63c05d68ddb554701fcddfd45b2e36addf32
parent08347648a6261fddc259fd846cf565a03875416a
cmd/pack: fix export data truncation bug

The binary export data format includes escaping to prevent "\n$$" from
appearing internally, but not "\n!\n". This could result in a false
positive when cmd/pack searched for "\n!\n" as the delimiter between
package definition and linker object.

To address this, this CL changes cmd/pack to also be aware of the
"\n$$" markers, and to ignore "\n!\n" within the export data.

Fixes #21703.

Change-Id: I71ea8ba49dbd066c7afb7717ddc0190e38fe5649
Reviewed-on: https://go-review.googlesource.com/60773
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/pack/pack.go
src/cmd/pack/pack_test.go