UdpTransport:IsIpAddressValid: Added extra :: check for ipv6

The code previously allowed ipv6 addresses with less than eight sections even without all-zero sections being compacted by a ::.

BUG=webrtc:1028

Review-Url: https://codereview.webrtc.org/2606383003
Cr-Commit-Position: refs/heads/master@{#16108}
This commit is contained in:
ossu 2017-01-17 02:31:37 -08:00 committed by Commit bot
parent da5e9d04f5
commit ece0571d44

View File

@ -2875,6 +2875,10 @@ bool UdpTransport::IsIpAddressValid(const char* ipadr, const bool ipV6)
{
return false;
}
if(nColons < 7 && nDubbleColons == 0)
{
return false;
}
if(!(nDots == 3 || nDots == 0))
{
return false;