]> granicus.if.org Git - php/commitdiff
Fixed a crash bug.
authorSterling Hughes <sterling@php.net>
Tue, 24 Apr 2001 22:10:41 +0000 (22:10 +0000)
committerSterling Hughes <sterling@php.net>
Tue, 24 Apr 2001 22:10:41 +0000 (22:10 +0000)
Return the proper amount.

ext/curl/curl.c

index 44ce1d60b88caa7ccf610434fcc01c708ef123a9..cfcdec13e3899addf7ed2963e2caef859a3eba0a 100644 (file)
@@ -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 **)&current) == 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 **)&current) == 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);
 
        }