summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorStefan Esser <sesser@php.net>2003-11-12 22:34:58 +0000
committerStefan Esser <sesser@php.net>2003-11-12 22:34:58 +0000
commitbefbd6d793b22934f3b1e9b0570dd34f0c044acc (patch)
treee110c8ea495acf3cf2669c00f079cd74d0e171f4 /main
parent3691ab699cfd335d62239540c096770cbe845eb8 (diff)
downloadphp-git-befbd6d793b22934f3b1e9b0570dd34f0c044acc.tar.gz
Fix odd increments to repair the boundary checks.
Diffstat (limited to 'main')
-rw-r--r--main/rfc1867.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/rfc1867.c b/main/rfc1867.c
index 0515494bde..1eaa0096ed 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -73,6 +73,10 @@ void php_mb_flush_gpc_variables(int num_vars, char **val_list, int *len_list, zv
void php_mb_gpc_realloc_buffer(char ***pval_list, int **plen_list, int *num_vars_max, int inc TSRMLS_DC)
{
+ /* allow only even increments */
+ if (inc & 1) {
+ inc++;
+ }
(*num_vars_max) += inc;
*pval_list = (char **)erealloc(*pval_list, (*num_vars_max+2)*sizeof(char *));
*plen_list = (int *)erealloc(*plen_list, (*num_vars_max+2)*sizeof(int));