From a59a85b598446fb45a7690808d3a238c741ecea1 Mon Sep 17 00:00:00 2001 From: Sterling Hughes Date: Tue, 24 Apr 2001 22:10:41 +0000 Subject: [PATCH] Fixed a crash bug. Return the proper amount. --- ext/curl/curl.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ext/curl/curl.c b/ext/curl/curl.c index 44ce1d60b8..cfcdec13e3 100644 --- a/ext/curl/curl.c +++ b/ext/curl/curl.c @@ -483,9 +483,6 @@ PHP_FUNCTION(curl_setopt) RETURN_FALSE; } - header = emalloc(sizeof(struct curl_slist)); - memset(header, 0, sizeof(struct curl_slist)); - for (zend_hash_internal_pointer_reset(headers); zend_hash_get_current_data(headers, (void **)¤t) == SUCCESS; zend_hash_move_forward(headers)) { @@ -520,9 +517,6 @@ PHP_FUNCTION(curl_setopt) RETURN_FALSE; } - commands = (struct curl_slist *) emalloc(sizeof(struct curl_slist)); - memset(commands, 0, sizeof(struct curl_slist)); - for (zend_hash_internal_pointer_reset(php_commands); zend_hash_get_current_data(php_commands, (void **)¤t) == SUCCESS; zend_hash_move_forward(php_commands)) { @@ -646,7 +640,7 @@ PHP_FUNCTION(curl_exec) if (is_temp_file) fclose(fp); - RETURN_STRINGL(ret_data, stat_sb.st_size, 0); + RETURN_STRINGL(ret_data, stat_sb.st_size + 1, 0); } -- 2.50.1