]> Cypherpunks repositories - gostls13.git/commit
bytes: fix panic in Map
authorRui Ueyama <ruiu@google.com>
Wed, 19 Mar 2014 03:52:58 +0000 (20:52 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 19 Mar 2014 03:52:58 +0000 (20:52 -0700)
commit1a21dbc5720326b0e325a54c3e01c0e50b32eb03
tree89850483dfa45085a0a4bcb454f01c0b3422ef14
parentf34251a91c2d075def51b763c52a0c602f3e09c9
bytes: fix panic in Map

utf8.RuneLen returns -1 for an invalid rune. In that case we
need to extend the internal buffer at least by 3 for \uFFFD.

Fixes #7577.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/77420044
src/pkg/bytes/bytes.go
src/pkg/bytes/bytes_test.go