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

Side by Side Diff: remoting/jingle_glue/iq_request.cc

Issue 7031055: remoting: Fix response validation error found by PVS Studio. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "remoting/jingle_glue/iq_request.h" 5 #include "remoting/jingle_glue/iq_request.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 } 238 }
239 239
240 const buzz::XmlElement* stun = query->FirstNamed(buzz::QN_JINGLE_INFO_STUN); 240 const buzz::XmlElement* stun = query->FirstNamed(buzz::QN_JINGLE_INFO_STUN);
241 if (stun) { 241 if (stun) {
242 for (const buzz::XmlElement* server = 242 for (const buzz::XmlElement* server =
243 stun->FirstNamed(buzz::QN_JINGLE_INFO_SERVER); 243 stun->FirstNamed(buzz::QN_JINGLE_INFO_SERVER);
244 server != NULL; 244 server != NULL;
245 server = server->NextNamed(buzz::QN_JINGLE_INFO_SERVER)) { 245 server = server->NextNamed(buzz::QN_JINGLE_INFO_SERVER)) {
246 std::string host = server->Attr(buzz::QN_JINGLE_INFO_HOST); 246 std::string host = server->Attr(buzz::QN_JINGLE_INFO_HOST);
247 std::string port_str = server->Attr(buzz::QN_JINGLE_INFO_UDP); 247 std::string port_str = server->Attr(buzz::QN_JINGLE_INFO_UDP);
248 if (host != buzz::STR_EMPTY && host != buzz::STR_EMPTY) { 248 if (host != buzz::STR_EMPTY && port_str != buzz::STR_EMPTY) {
249 int port; 249 int port;
250 if (!base::StringToInt(port_str, &port)) { 250 if (!base::StringToInt(port_str, &port)) {
251 LOG(WARNING) << "Unable to parse port in stanza" << stanza->Str(); 251 LOG(WARNING) << "Unable to parse port in stanza" << stanza->Str();
252 } else { 252 } else {
253 stun_hosts.push_back(talk_base::SocketAddress(host, port)); 253 stun_hosts.push_back(talk_base::SocketAddress(host, port));
254 } 254 }
255 } 255 }
256 } 256 }
257 } 257 }
258 258
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 void SessionStartRequest::OnOutgoingMessage( 320 void SessionStartRequest::OnOutgoingMessage(
321 cricket::SessionManager* session_manager, 321 cricket::SessionManager* session_manager,
322 const buzz::XmlElement* stanza) { 322 const buzz::XmlElement* stanza) {
323 // TODO(ajwong): Are we just supposed to not use |session_manager|? 323 // TODO(ajwong): Are we just supposed to not use |session_manager|?
324 DCHECK_EQ(session_manager, session_manager_); 324 DCHECK_EQ(session_manager, session_manager_);
325 scoped_ptr<buzz::XmlElement> stanza_copy(new buzz::XmlElement(*stanza)); 325 scoped_ptr<buzz::XmlElement> stanza_copy(new buzz::XmlElement(*stanza));
326 request_->SendRawIq(stanza_copy.get()); 326 request_->SendRawIq(stanza_copy.get());
327 } 327 }
328 328
329 } // namespace remoting 329 } // namespace remoting
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