Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: net/base/net_util.cc

Issue 8418034: Make string_util::WriteInto() DCHECK() that the supplied |length_with_null| > 1, meaning that the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/base/net_util.cc
===================================================================
--- net/base/net_util.cc (revision 107404)
+++ net/base/net_util.cc (working copy)
@@ -209,8 +209,11 @@
}
enum RFC2047EncodingType {Q_ENCODING, B_ENCODING};
-bool DecodeBQEncoding(const std::string& part, RFC2047EncodingType enc_type,
- const std::string& charset, std::string* output) {
+bool DecodeBQEncoding(const std::string& part,
+ RFC2047EncodingType enc_type,
+ const std::string& charset,
+ std::string* output) {
+ DCHECK(!part.empty()); // TODO(pkasting): Not sure about this.
std::string decoded;
if (enc_type == B_ENCODING) {
if (!base::Base64Decode(part, &decoded)) {
@@ -221,6 +224,7 @@
return false;
}
}
+ DCHECK(!decoded.empty());
UErrorCode err = U_ZERO_ERROR;
UConverter* converter(ucnv_open(charset.c_str(), &err));

Powered by Google App Engine
This is Rietveld 408576698