Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2677)

Issue 75340044: code review 75340044: base64: fix bug that decoder fails to detect corruption (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 2 months ago by ruiu
Modified:
10 years, 2 months ago
Reviewers:
nigeltao
CC:
golang-codereviews, bradfitz, nigeltao
Visibility:
Public.

Description

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.

Patch Set 1 #

Patch Set 2 : diff -r 32b8c26e4414 https://code.google.com/p/go #

Patch Set 3 : diff -r 32b8c26e4414 https://code.google.com/p/go #

Total comments: 6

Patch Set 4 : diff -r 262af7c32d11 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -9 lines) Patch
M src/pkg/encoding/base64/base64.go View 1 2 3 2 chunks +19 lines, -8 lines 0 comments Download
M src/pkg/encoding/base64/base64_test.go View 1 2 3 1 chunk +5 lines, -1 line 0 comments Download

Messages

Total messages: 6
ruiu
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
10 years, 2 months ago (2014-03-17 07:29:32 UTC) #1
bradfitz
R=nigeltao On Mon, Mar 17, 2014 at 12:29 AM, <ruiu@google.com> wrote: > Reviewers: golang-codereviews, > ...
10 years, 2 months ago (2014-03-17 18:22:38 UTC) #2
nigeltao
https://codereview.appspot.com/75340044/diff/40001/src/pkg/encoding/base64/base64.go File src/pkg/encoding/base64/base64.go (right): https://codereview.appspot.com/75340044/diff/40001/src/pkg/encoding/base64/base64.go#newcode229 src/pkg/encoding/base64/base64.go:229: for j := 0; j < 4; j++ { ...
10 years, 2 months ago (2014-03-18 05:50:10 UTC) #3
ruiu
PTAL. https://codereview.appspot.com/75340044/diff/40001/src/pkg/encoding/base64/base64.go File src/pkg/encoding/base64/base64.go (right): https://codereview.appspot.com/75340044/diff/40001/src/pkg/encoding/base64/base64.go#newcode229 src/pkg/encoding/base64/base64.go:229: for j := 0; j < 4; j++ ...
10 years, 2 months ago (2014-03-18 17:48:32 UTC) #4
nigeltao
LGTM.
10 years, 2 months ago (2014-03-20 05:00:09 UTC) #5
nigeltao
10 years, 2 months ago (2014-03-20 05:00:45 UTC) #6
*** Submitted as https://code.google.com/p/go/source/detail?r=7aeb36fc114b ***

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://codereview.appspot.com/75340044

Committer: Nigel Tao <nigeltao@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b