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

Unified Diff: media/cast/test/utility/udp_proxy_main.cc

Issue 655063002: Use uint16 for port numbers more pervasively. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert bad change Created 6 years, 1 month 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 | « media/cast/test/sender.cc ('k') | net/base/host_mapping_rules.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/test/utility/udp_proxy_main.cc
diff --git a/media/cast/test/utility/udp_proxy_main.cc b/media/cast/test/utility/udp_proxy_main.cc
index ddb9011330b2acc164db9ff615345a3ea9f28825..d2a03c685978989e26c226ddde5f03fbffab483c 100644
--- a/media/cast/test/utility/udp_proxy_main.cc
+++ b/media/cast/test/utility/udp_proxy_main.cc
@@ -153,8 +153,15 @@ int main(int argc, char** argv) {
// V1 proxy
network_type = argv[2];
}
- net::IPEndPoint remote_endpoint(remote_ip_number, remote_port);
- net::IPEndPoint local_endpoint(local_ip_number, local_port);
+ if (local_port < 0 || local_port > 65535 || remote_port < 0 ||
+ remote_port > 65535) {
+ fprintf(stderr, "Port numbers must be between 0 and 65535\n");
+ exit(1);
+ }
+ net::IPEndPoint remote_endpoint(remote_ip_number,
+ static_cast<uint16>(remote_port));
+ net::IPEndPoint local_endpoint(local_ip_number,
+ static_cast<uint16>(local_port));
scoped_ptr<media::cast::test::PacketPipe> in_pipe, out_pipe;
scoped_ptr<media::cast::test::InterruptedPoissonProcess> ipp(
media::cast::test::DefaultInterruptedPoissonProcess());
« no previous file with comments | « media/cast/test/sender.cc ('k') | net/base/host_mapping_rules.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698