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

Unified Diff: content/public/common/common_param_traits.cc

Issue 183023016: Check IP address size when deserializing IPEndPoint. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Also allow empty IPEndPoints across the wire. Created 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/common_param_traits.cc
diff --git a/content/public/common/common_param_traits.cc b/content/public/common/common_param_traits.cc
index 7c47ab53907ae1b3c38154e6392244cdedff7fae..474fb7a0d523f129f0c13ac31e398a2af91ab86d 100644
--- a/content/public/common/common_param_traits.cc
+++ b/content/public/common/common_param_traits.cc
@@ -120,6 +120,11 @@ bool ParamTraits<net::IPEndPoint>::Read(const Message* m, PickleIterator* iter,
int port;
if (!ReadParam(m, iter, &address) || !ReadParam(m, iter, &port))
return false;
+ if (address.size() &&
+ address.size() != net::kIPv4AddressSize &&
+ address.size() != net::kIPv6AddressSize) {
+ return false;
+ }
*p = net::IPEndPoint(address, port);
return true;
}
« 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