go/src/internal
Michael Munday 11cdbab9d4 bytes, internal/bytealg: fix incorrect IndexString usage
The IndexString implementation in the bytealg package requires that
the string passed into it be in the range '2 <= len(s) <= MaxLen'
where MaxLen may be any value (including 0).

CL 156998 added calls to bytealg.IndexString where MaxLen was not
first checked. This led to an illegal instruction on s390x with
the vector facility disabled.

This CL guards the calls to bytealg.IndexString with a MaxLen check.
If the check fails then the code now falls back to the pre CL 156998
implementation (a loop over the runes in the string).

Since the MaxLen check is now in place the generic implementation is
no longer called so I have returned it to its original unimplemented
state.

In future we may want to drop MaxLen to prevent this kind of
confusion.

Fixes #41552.

Change-Id: Ibeb3f08720444a05c08d719ed97f6cef2423bbe9
Reviewed-on: https://go-review.googlesource.com/c/go/+/256717
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Michael Munday <mike.munday@ibm.com>
Reviewed-by: Keith Randall <khr@golang.org>
2020-09-23 19:55:33 +00:00
..
bytealg bytes, internal/bytealg: fix incorrect IndexString usage 2020-09-23 19:55:33 +00:00
cfg cmd/go: remove GOAMD64 environment variable 2020-05-20 19:21:43 +00:00
cpu internal/cpu: unify HWCap/HWCap2 comments 2020-04-13 10:26:24 +00:00
fmtsort src: gofmt -s 2019-09-09 18:57:05 +00:00
goroot internal/goroot: for -compiler=gccgo, only look for .gox files 2019-09-18 20:32:43 +00:00
goversion internal/goversion: update Version to 1.16 2020-08-12 15:02:24 +00:00
lazyregexp internal/lazytemplate: add a lazy template wrapper 2019-02-27 23:49:01 +00:00
lazytemplate internal/lazytemplate: add a lazy template wrapper 2019-02-27 23:49:01 +00:00
nettrace
obscuretestdata all: base64-encode binaries that will cause Apple notarization to fail 2019-11-21 14:55:12 +00:00
oserror all: remove os.ErrTimeout 2019-08-02 17:57:18 +00:00
poll all: add GOOS=ios 2020-09-23 18:12:59 +00:00
profile net/http/pprof: support the "seconds" param for block, mutex profiles 2020-04-17 19:35:56 +00:00
race
reflectlite internal/unsafeheader: consolidate stringHeader and sliceHeader declarations into an internal package 2020-05-01 02:31:29 +00:00
singleflight internal/singleflight: format someErr 2019-10-25 16:31:41 +00:00
syscall os, internal/syscall/unix: use pipe2 instead of pipe on illumos 2020-09-16 08:49:14 +00:00
testenv all: add GOOS=ios 2020-09-23 18:12:59 +00:00
testlog cmd/go, testing, os: fail test that calls os.Exit(0) 2020-08-27 23:19:15 +00:00
trace internal/trace: add license header to writer.go 2020-05-10 10:22:35 +00:00
unsafeheader internal/unsafeheader: fix reference in godoc comment for type String 2020-05-01 16:14:17 +00:00
xcoff internal/xcoff: fix wrong bit masking comparisons 2020-03-09 18:07:53 +00:00