diff options
author | cdn@chromium.org <cdn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-11 17:55:52 +0000 |
---|---|---|
committer | cdn@chromium.org <cdn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-11 17:55:52 +0000 |
commit | 76e6e7c63aaa8e30e4143b8db9fc7d754812e718 (patch) | |
tree | 58bec39485b615929236bfce1341c45274e2a23f /chrome/common/net | |
parent | 5f58c2afdeae4f8895d9da0afdc1c5a82c250e4c (diff) | |
download | chromium_src-76e6e7c63aaa8e30e4143b8db9fc7d754812e718.zip chromium_src-76e6e7c63aaa8e30e4143b8db9fc7d754812e718.tar.gz chromium_src-76e6e7c63aaa8e30e4143b8db9fc7d754812e718.tar.bz2 |
return early from ProcessRawBytesWithSeperators() when data length is 0
BUG=109717
TEST=N/A
Review URL: http://codereview.chromium.org/9169028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117241 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/net')
-rw-r--r-- | chrome/common/net/x509_certificate_model.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/common/net/x509_certificate_model.cc b/chrome/common/net/x509_certificate_model.cc index 8f9b8a2..950b4f2 100644 --- a/chrome/common/net/x509_certificate_model.cc +++ b/chrome/common/net/x509_certificate_model.cc @@ -59,6 +59,10 @@ std::string ProcessRawBytesWithSeparators(const unsigned char* data, // except for the last byte. std::string ret; size_t kMin = 0U; + + if (!data_length) + return ""; + ret.reserve(std::max(kMin, data_length * 3 - 1)); for (size_t i = 0; i < data_length; ++i) { |