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

Unified Diff: base/rand_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: base/rand_util.cc
===================================================================
--- base/rand_util.cc (revision 107404)
+++ base/rand_util.cc (working copy)
@@ -71,6 +71,7 @@
}
std::string RandBytesAsString(size_t length) {
+ DCHECK_GT(length, 0u);
std::string result;
RandBytes(WriteInto(&result, length + 1), length);
return result;
« no previous file with comments | « base/rand_util.h ('k') | base/rand_util_unittest.cc » ('j') | base/string_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698