From: Antony Dovgal Date: Wed, 20 Dec 2006 23:36:56 +0000 (+0000) Subject: MFH X-Git-Tag: php-5.2.1RC2~128 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0abe62e0271a62d0e8c53c540d466267a045797a;p=php MFH --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 1be460d73e..36807aa630 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -4045,7 +4045,13 @@ PHP_FUNCTION(parse_str) int php_tag_find(char *tag, int len, char *set) { char c, *n, *t; int state=0, done=0; - char *norm = emalloc(len+1); + char *norm; + + if (len <= 0) { + return 0; + } + + norm = emalloc(len+1); n = norm; t = tag; @@ -4055,9 +4061,6 @@ int php_tag_find(char *tag, int len, char *set) { and turn any into just and any into */ - if (!len) { - return 0; - } while (!done) { switch (c) { case '<':