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

Unified Diff: chrome/browser/mac/install_from_dmg.mm

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: chrome/browser/mac/install_from_dmg.mm
===================================================================
--- chrome/browser/mac/install_from_dmg.mm (revision 107404)
+++ chrome/browser/mac/install_from_dmg.mm (working copy)
@@ -141,6 +141,10 @@
CFDataRef image_path_data = static_cast<CFDataRef>(
image_path_cftyperef.get());
CFIndex length = CFDataGetLength(image_path_data);
+ if (length <= 0) {
+ LOG(ERROR) << "image_path_data is unexpectedly empty";
+ return true;
+ }
char* image_path_c = WriteInto(image_path, length + 1);
CFDataGetBytes(image_path_data,
CFRangeMake(0, length),

Powered by Google App Engine
This is Rietveld 408576698