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

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

Issue 1133007: Merge 42204 - Fix the outofbounds array read in the ftp response.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/249/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) 2008 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2008 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/string_util.h" 8 #include "base/string_util.h"
9 #include "net/base/connection_type_histograms.h" 9 #include "net/base/connection_type_histograms.h"
10 #include "net/base/escape.h" 10 #include "net/base/escape.h"
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 std::string::size_type quote_pos = line.find('"'); 716 std::string::size_type quote_pos = line.find('"');
717 if (quote_pos != std::string::npos) { 717 if (quote_pos != std::string::npos) {
718 line = line.substr(quote_pos + 1); 718 line = line.substr(quote_pos + 1);
719 quote_pos = line.find('"'); 719 quote_pos = line.find('"');
720 if (quote_pos == std::string::npos) 720 if (quote_pos == std::string::npos)
721 return Stop(ERR_INVALID_RESPONSE); 721 return Stop(ERR_INVALID_RESPONSE);
722 line = line.substr(0, quote_pos); 722 line = line.substr(0, quote_pos);
723 } 723 }
724 if (system_type_ == SYSTEM_TYPE_VMS) 724 if (system_type_ == SYSTEM_TYPE_VMS)
725 line = FtpUtil::VMSPathToUnix(line); 725 line = FtpUtil::VMSPathToUnix(line);
726 if (line[line.length() - 1] == '/') 726 if (line.length() && line[line.length() - 1] == '/')
727 line.erase(line.length() - 1); 727 line.erase(line.length() - 1);
728 current_remote_directory_ = line; 728 current_remote_directory_ = line;
729 next_state_ = STATE_CTRL_WRITE_TYPE; 729 next_state_ = STATE_CTRL_WRITE_TYPE;
730 break; 730 break;
731 } 731 }
732 case ERROR_CLASS_INFO_NEEDED: 732 case ERROR_CLASS_INFO_NEEDED:
733 return Stop(ERR_INVALID_RESPONSE); 733 return Stop(ERR_INVALID_RESPONSE);
734 case ERROR_CLASS_TRANSIENT_ERROR: 734 case ERROR_CLASS_TRANSIENT_ERROR:
735 return Stop(ERR_FAILED); 735 return Stop(ERR_FAILED);
736 case ERROR_CLASS_PERMANENT_ERROR: 736 case ERROR_CLASS_PERMANENT_ERROR:
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 read_data_buf_->data()[0] = 0; 1092 read_data_buf_->data()[0] = 0;
1093 return data_socket_->Read(read_data_buf_, read_data_buf_len_, 1093 return data_socket_->Read(read_data_buf_, read_data_buf_len_,
1094 &io_callback_); 1094 &io_callback_);
1095 } 1095 }
1096 1096
1097 int FtpNetworkTransaction::DoDataReadComplete(int result) { 1097 int FtpNetworkTransaction::DoDataReadComplete(int result) {
1098 return result; 1098 return result;
1099 } 1099 }
1100 1100
1101 } // namespace net 1101 } // 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