Skip to content

Commit

Permalink
Check for overlong (but otherwise valid) sections.
Browse files Browse the repository at this point in the history
  • Loading branch information
gsnedders committed Mar 16, 2010
1 parent 74a182a commit c39be86
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/net_ipv6.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ public static function check_ipv6($ip)
if ($ipv6_part === '')
return false;

// Nor can it be over four characters
if (strlen($ipv6_part) > 4)
return false;

// Remove leading zeros (this is safe because of the above)
$ipv6_part = ltrim($ipv6_part, '0');
if ($ipv6_part === '')
Expand Down

0 comments on commit c39be86

Please sign in to comment.