From: Sterling Hughes Date: Tue, 24 Apr 2001 22:10:41 +0000 (+0000) Subject: Fixed a crash bug. X-Git-Tag: php-4.0.6RC1~327 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a59a85b598446fb45a7690808d3a238c741ecea1;p=php Fixed a crash bug. Return the proper amount. --- 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); }