From: Ilia Alshanetsky Date: Mon, 20 Oct 2008 23:23:53 +0000 (+0000) Subject: MFB: Fixed bug #46343 (IPv6 address filter accepts invalid address) X-Git-Tag: BEFORE_HEAD_NS_CHANGE~191 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=42e1ad74211696e5bf8ace6be868e1776c798c10;p=php MFB: Fixed bug #46343 (IPv6 address filter accepts invalid address) --- diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index 211d2c7cf0..df746b266f 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -533,6 +533,7 @@ static int _php_filter_validate_ipv6(char *str, int str_len TSRMLS_DC) /* {{{ */ char *ipv4; char *end; int ip4elm[4]; + char *s = str; if (!memchr(str, ':', str_len)) { return 0; @@ -572,6 +573,8 @@ static int _php_filter_validate_ipv6(char *str, int str_len TSRMLS_DC) /* {{{ */ return 1; } compressed = 1; + } else if ((str - 1) == s) { + return 0; } } n = 0;