From 77ebea3a6f26b062c54818144a2ecd6cfa78bd0b Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Mon, 8 Jan 2001 20:10:16 +0000 Subject: [PATCH] Duplicate property value, otherwise parser would free it and we're in bad shape. --- ext/standard/browscap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 250447432c6..9383eada28a 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -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;