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

Side by Side Diff: net/test/test_server.cc

Issue 5377005: Fixed port boundary check in test_server.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/test/test_server.h" 5 #include "net/test/test_server.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 LOG(ERROR) << "Could not parse server data: " 390 LOG(ERROR) << "Could not parse server data: "
391 << json_reader.GetErrorMessage(); 391 << json_reader.GetErrorMessage();
392 return false; 392 return false;
393 } 393 }
394 DictionaryValue* dict = static_cast<DictionaryValue*>(value.get()); 394 DictionaryValue* dict = static_cast<DictionaryValue*>(value.get());
395 int port = 0; 395 int port = 0;
396 if (!dict->GetInteger("port", &port)) { 396 if (!dict->GetInteger("port", &port)) {
397 LOG(ERROR) << "Could not find port value"; 397 LOG(ERROR) << "Could not find port value";
398 return false; 398 return false;
399 } 399 }
400 if ((port <= 0) || (port >= kuint16max)) { 400 if ((port <= 0) || (port > kuint16max)) {
401 LOG(ERROR) << "Invalid port value: " << port; 401 LOG(ERROR) << "Invalid port value: " << port;
402 return false; 402 return false;
403 } 403 }
404 host_port_pair_.set_port(port); 404 host_port_pair_.set_port(port);
405 return true; 405 return true;
406 } 406 }
407 407
408 } // namespace net 408 } // 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