sesser Mon Nov 3 04:16:25 2003 EDT
Modified files:
/php-src/main rfc1867.c
Log:
It is usually a good idea to write only into allocated bufferspace.
Index: php-src/main/rfc1867.c
diff -u php-src/main/rfc1867.c:1.142 php-src/main/rfc1867.c:1.143
--- php-src/main/rfc1867.c:1.142 Wed Oct 22 10:14:04 2003
+++ php-src/main/rfc1867.c Mon Nov 3 04:16:24 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: rfc1867.c,v 1.142 2003/10/22 14:14:04 hirokawa Exp $ */
+/* $Id: rfc1867.c,v 1.143 2003/11/03 09:16:24 sesser Exp $ */
/*
* This product includes software developed by the Apache Group
@@ -78,8 +78,8 @@
if (*num_vars>=*num_vars_max){
(*num_vars_max) += 16;
- *pval_list = (char **)erealloc(val_list, *num_vars_max*sizeof(char *));
- *plen_list = (int *)erealloc(len_list, *num_vars_max*sizeof(int));
+ *pval_list = (char **)erealloc(val_list, (*num_vars_max+2)*sizeof(char
*));
+ *plen_list = (int *)erealloc(len_list, (*num_vars_max+2)*sizeof(int));
val_list=*pval_list;
len_list=*plen_list;
}
@@ -755,7 +755,7 @@
int max_file_size=0, skip_upload=0, anonindex=0, is_anonymous;
zval *http_post_files=NULL;
#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING)
- int str_len = 0, num_vars = 0, num_vars_max = 2*10+1, *len_list = NULL;
+ int str_len = 0, num_vars = 0, num_vars_max = 2*10, *len_list = NULL;
char **val_list = NULL;
#endif
zend_bool magic_quotes_gpc;
@@ -814,8 +814,8 @@
#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING)
if (php_mb_encoding_translation(TSRMLS_C)) {
- val_list = (char **)ecalloc(num_vars_max, sizeof(char *));
- len_list = (int *)ecalloc(num_vars_max, sizeof(int));
+ val_list = (char **)ecalloc(num_vars_max+2, sizeof(char *));
+ len_list = (int *)ecalloc(num_vars_max+2, sizeof(int));
}
#endif
zend_llist_init(&header, sizeof(mime_header_entry), (llist_dtor_func_t)
php_free_hdr_entry, 0);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php