diff options
author | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-17 18:34:59 +0000 |
---|---|---|
committer | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-17 18:34:59 +0000 |
commit | c8838bfc3b374907022d891b9ee6482122f4ab82 (patch) | |
tree | 632362695cc4503adeff17747a50573efcbeb996 /base/base64.cc | |
parent | 63650328e129c873c4cf677a217f46b2f9401688 (diff) | |
download | chromium_src-c8838bfc3b374907022d891b9ee6482122f4ab82.zip chromium_src-c8838bfc3b374907022d891b9ee6482122f4ab82.tar.gz chromium_src-c8838bfc3b374907022d891b9ee6482122f4ab82.tar.bz2 |
Address outstanding comments from CL 10384140
This adds some clarifying comments, no code-changes here.
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10406022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137695 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/base64.cc')
-rw-r--r-- | base/base64.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/base/base64.cc b/base/base64.cc index 62bd12d..1907978 100644 --- a/base/base64.cc +++ b/base/base64.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -14,7 +14,9 @@ bool Base64Encode(const StringPiece& input, std::string* output) { // null terminates result since result is base64 text! int input_size = static_cast<int>(input.size()); - int output_size= modp_b64_encode(&(temp[0]), input.data(), input_size); + + // modp_b64_encode_len() returns at least 1, so temp[0] is safe to use. + int output_size = modp_b64_encode(&(temp[0]), input.data(), input_size); if (output_size < 0) return false; |