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

Side by Side Diff: net/ftp/ftp_network_transaction.cc

Issue 1082008: Fix the out-of-bounds array read in the ftp response... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "net/ftp/ftp_network_transaction.h" 5 #include "net/ftp/ftp_network_transaction.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/histogram.h" 8 #include "base/histogram.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 std::string::size_type quote_pos = line.find('"'); 732 std::string::size_type quote_pos = line.find('"');
733 if (quote_pos != std::string::npos) { 733 if (quote_pos != std::string::npos) {
734 line = line.substr(quote_pos + 1); 734 line = line.substr(quote_pos + 1);
735 quote_pos = line.find('"'); 735 quote_pos = line.find('"');
736 if (quote_pos == std::string::npos) 736 if (quote_pos == std::string::npos)
737 return Stop(ERR_INVALID_RESPONSE); 737 return Stop(ERR_INVALID_RESPONSE);
738 line = line.substr(0, quote_pos); 738 line = line.substr(0, quote_pos);
739 } 739 }
740 if (system_type_ == SYSTEM_TYPE_VMS) 740 if (system_type_ == SYSTEM_TYPE_VMS)
741 line = FtpUtil::VMSPathToUnix(line); 741 line = FtpUtil::VMSPathToUnix(line);
742 if (line[line.length() - 1] == '/') 742 if (line.length() && line[line.length() - 1] == '/')
743 line.erase(line.length() - 1); 743 line.erase(line.length() - 1);
744 current_remote_directory_ = line; 744 current_remote_directory_ = line;
745 next_state_ = STATE_CTRL_WRITE_TYPE; 745 next_state_ = STATE_CTRL_WRITE_TYPE;
746 break; 746 break;
747 } 747 }
748 case ERROR_CLASS_INFO_NEEDED: 748 case ERROR_CLASS_INFO_NEEDED:
749 return Stop(ERR_INVALID_RESPONSE); 749 return Stop(ERR_INVALID_RESPONSE);
750 case ERROR_CLASS_TRANSIENT_ERROR: 750 case ERROR_CLASS_TRANSIENT_ERROR:
751 return Stop(ERR_FAILED); 751 return Stop(ERR_FAILED);
752 case ERROR_CLASS_PERMANENT_ERROR: 752 case ERROR_CLASS_PERMANENT_ERROR:
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 if (!had_error_type[type]) { 1243 if (!had_error_type[type]) {
1244 had_error_type[type] = true; 1244 had_error_type[type] = true;
1245 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened", 1245 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened",
1246 type, NUM_OF_NET_ERROR_TYPES); 1246 type, NUM_OF_NET_ERROR_TYPES);
1247 } 1247 }
1248 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount", 1248 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount",
1249 type, NUM_OF_NET_ERROR_TYPES); 1249 type, NUM_OF_NET_ERROR_TYPES);
1250 } 1250 }
1251 1251
1252 } // namespace net 1252 } // namespace net
OLDNEW
« 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