]> Cypherpunks repositories - gostls13.git/commit
base64: fix bug that decoder fails to detect corruption
authorRui Ueyama <ruiu@google.com>
Thu, 20 Mar 2014 05:00:34 +0000 (16:00 +1100)
committerNigel Tao <nigeltao@golang.org>
Thu, 20 Mar 2014 05:00:34 +0000 (16:00 +1100)
commita2770af447a470cf34841f09d0a5bf23a9b5ea9e
tree2eec5480deb493375d7e5b5abf44866e4e70c105
parent90a66fa6aff43214298bbb3e184b2eb8c2bd6850
base64: fix bug that decoder fails to detect corruption

Encoding.Decode() failed to detect trailing garbages if input contains "==" followed by garbage smaller than 3 bytes (for example, it failed to detect "x" in "AA==x"). This patch fixes the bug and adds a few tests.

LGTM=nigeltao
R=golang-codereviews, bradfitz, nigeltao
CC=golang-codereviews
https://golang.org/cl/75340044
src/pkg/encoding/base64/base64.go
src/pkg/encoding/base64/base64_test.go