]> granicus.if.org Git - php/commitdiff
MFH
authorAntony Dovgal <tony2001@php.net>
Wed, 20 Dec 2006 23:37:27 +0000 (23:37 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 20 Dec 2006 23:37:27 +0000 (23:37 +0000)
ext/standard/string.c

index 9cc6e11a013123ae14742b722ff2a5a6ef764098..0e6fb6b96509fbfeca15c72a83859727f8a93e06 100644 (file)
@@ -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 <a whatever...> into just <a> and any </tag>
           into <tag>
        */
-       if (!len) {
-               return 0;
-       }
        while (!done) {
                switch (c) {
                        case '<':