]> granicus.if.org Git - php/commitdiff
Duplicate property value, otherwise parser would free it and we're in bad shape.
authorStanislav Malyshev <stas@php.net>
Mon, 8 Jan 2001 20:10:16 +0000 (20:10 +0000)
committerStanislav Malyshev <stas@php.net>
Mon, 8 Jan 2001 20:10:16 +0000 (20:10 +0000)
ext/standard/browscap.c

index 250447432c61818558a03349e8c6559818834d95..9383eada28adf5c26599ddeef80a19697111e4b1 100644 (file)
@@ -92,7 +92,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, int callback_type, vo
 
                                new_property = (zval *) malloc(sizeof(zval));
                                INIT_PZVAL(new_property);
-                               new_property->value.str.val = Z_STRVAL_P(arg2);
+                               new_property->value.str.val = zend_strndup(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2));
                                new_property->value.str.len = Z_STRLEN_P(arg2);
                                new_property->type = IS_STRING;