1
0
mirror of https://github.com/golang/go synced 2024-09-30 18:18:32 -06:00
go/cmd/stringer
Nick Craig-Wood 578c521fc2 cmd/stringer: fix panic caused by integer overflow
When String() was called on the maximum value of an integer type (eg
255 for uint8) this would cause an integer overflow, which would cause
an index error later in the code.

Fixed by re-arranging the code slightly.

Fixes golang/go#10563

Change-Id: I9fd016afc5eea22adbc3843f6081091fd50deccf
Reviewed-on: https://go-review.googlesource.com/9255
Reviewed-by: Rob Pike <r@golang.org>
2015-06-02 19:44:20 +00:00
..
testdata cmd/stringer: fix panic caused by integer overflow 2015-06-02 19:44:20 +00:00
endtoend_test.go cmd/stringer: fix ignored error in TestEndToEnd. 2015-01-15 23:10:50 +00:00
golden_test.go cmd/stringer: fix panic caused by integer overflow 2015-06-02 19:44:20 +00:00
stringer.go cmd/stringer: fix panic caused by integer overflow 2015-06-02 19:44:20 +00:00
util_test.go go.tools/cmd/stringer: add tests 2014-09-04 14:16:59 -07:00