]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/buildid: reject empty id
authorRuss Cox <rsc@golang.org>
Fri, 20 Aug 2021 19:20:10 +0000 (15:20 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 20 Aug 2021 20:20:19 +0000 (20:20 +0000)
commit835ff47c1680de81b93480f5184ac4034c45e417
treed78554ebddcb4799c815d42373feae9f6dfd2501
parentf67e31d643b1d23abc1f24ebfa50ef51519d1348
cmd/internal/buildid: reject empty id

The loop that makes progress assumes that after matching an id
you should advance len(id) bytes in the file. If id is the empty string,
then it will match and advance 0 bytes repeatedly.

0-byte ids are not really build IDs, so just reject it outright.

Fixes #47852.

Change-Id: Ie44a3a51dec22e2f68fb72d54ead91be98000cfe
Reviewed-on: https://go-review.googlesource.com/c/go/+/344049
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/cmd/internal/buildid/buildid_test.go
src/cmd/internal/buildid/rewrite.go