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

Unified Diff: net/ftp/ftp_directory_listing_parser_ls.cc

Issue 1451993007: Fix FTP dir listing parser to support servers returning a "total n" line with an incorrect negative… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « net/data/ftp/dir-listing-ls-33.expected ('k') | net/ftp/ftp_directory_listing_parser_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_directory_listing_parser_ls.cc
diff --git a/net/ftp/ftp_directory_listing_parser_ls.cc b/net/ftp/ftp_directory_listing_parser_ls.cc
index 96d0dc84607a40f934a2eb882ad06249451db970..b259cad0111bb3b2b8c2244f0a4e6a96417b9870 100644
--- a/net/ftp/ftp_directory_listing_parser_ls.cc
+++ b/net/ftp/ftp_directory_listing_parser_ls.cc
@@ -142,11 +142,12 @@ bool ParseFtpDirectoryListingLs(
if (columns.size() == 2 && !received_total_line) {
received_total_line = true;
+ // Some FTP servers incorrectly return a negative integer for "n". Since
+ // this value is ignored anyway, just check any valid integer was
+ // provided.
int64 total_number;
if (!base::StringToInt64(columns[1], &total_number))
return false;
- if (total_number < 0)
- return false;
continue;
}
« no previous file with comments | « net/data/ftp/dir-listing-ls-33.expected ('k') | net/ftp/ftp_directory_listing_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698