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

Unified Diff: chrome/common/safe_browsing/zip_analyzer.cc

Issue 14080002: Check for errors when calling ZipReader::AdvanceToNextEntry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/safe_browsing/zip_analyzer.cc
===================================================================
--- chrome/common/safe_browsing/zip_analyzer.cc (revision 193255)
+++ chrome/common/safe_browsing/zip_analyzer.cc (working copy)
@@ -18,7 +18,12 @@
return;
}
- for (; reader.HasMore(); reader.AdvanceToNextEntry()) {
+ bool advanced = true;
+ for (; reader.HasMore(); advanced = reader.AdvanceToNextEntry()) {
+ if (!advanced) {
mattm 2013/04/10 20:05:22 maybe cleaner to use a while loop like: while (has
Brian Ryner 2013/04/10 20:11:47 I'm not sure how much cleaner that turns out to be
mattm 2013/04/10 20:23:27 ah, right.
+ VLOG(1) << "Could not advance to next entry, aborting zip scan.";
+ return;
+ }
if (!reader.OpenCurrentEntryInZip()) {
VLOG(1) << "Failed to open current entry in zip file";
continue;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698