From 6f53386349a73f8be8dd5d1d3a84abbb8e222f8e Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Wed, 20 Dec 2006 23:37:27 +0000 Subject: [PATCH] MFH --- ext/standard/string.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 '<': -- 2.50.1