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

Unified Diff: webrtc/base/socketaddress.h

Issue 2675273003: Fixing SDP parsing crash due to invalid port numbers. (Closed)
Patch Set: IsValidPort function Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/pc/webrtcsdp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/socketaddress.h
diff --git a/webrtc/base/socketaddress.h b/webrtc/base/socketaddress.h
index 175d7a9d121157291a55705bc8da9765b0d65245..bcff3900b8990dbfe74bbc8c6ad8e97678d97eda 100644
--- a/webrtc/base/socketaddress.h
+++ b/webrtc/base/socketaddress.h
@@ -32,13 +32,16 @@ class SocketAddress {
// Creates the address with the given host and port. Host may be a
// literal IP string or a hostname to be resolved later.
+ // DCHECKs that port is in valid range (0 to 2^16-1).
SocketAddress(const std::string& hostname, int port);
// Creates the address with the given IP and port.
// IP is given as an integer in host byte order. V4 only, to be deprecated.
+ // DCHECKs that port is in valid range (0 to 2^16-1).
SocketAddress(uint32_t ip_as_host_order_integer, int port);
// Creates the address with the given IP and port.
+ // DCHECKs that port is in valid range (0 to 2^16-1).
SocketAddress(const IPAddress& ip, int port);
// Creates a copy of the given address.
@@ -77,6 +80,7 @@ class SocketAddress {
void SetResolvedIP(const IPAddress& ip);
// Changes the port of this address to the given one.
+ // DCHECKs that port is in valid range (0 to 2^16-1).
void SetPort(int port);
// Returns the hostname.
« no previous file with comments | « no previous file | webrtc/pc/webrtcsdp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698