Commit 835ff47c authored by Russ Cox's avatar Russ Cox
Browse files

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: default avatarMichael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
parent f67e31d6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment