From: Antony Dovgal Date: Wed, 20 Dec 2006 23:37:27 +0000 (+0000) Subject: MFH X-Git-Tag: php-4.4.5RC1~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f53386349a73f8be8dd5d1d3a84abbb8e222f8e;p=php MFH --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 9cc6e11a01..0e6fb6b965 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -3224,7 +3224,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; @@ -3234,9 +3240,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 '<':