diff options
author | Stefan Esser <sesser@php.net> | 2003-11-12 22:34:58 +0000 |
---|---|---|
committer | Stefan Esser <sesser@php.net> | 2003-11-12 22:34:58 +0000 |
commit | befbd6d793b22934f3b1e9b0570dd34f0c044acc (patch) | |
tree | e110c8ea495acf3cf2669c00f079cd74d0e171f4 /main | |
parent | 3691ab699cfd335d62239540c096770cbe845eb8 (diff) | |
download | php-git-befbd6d793b22934f3b1e9b0570dd34f0c044acc.tar.gz |
Fix odd increments to repair the boundary checks.
Diffstat (limited to 'main')
-rw-r--r-- | main/rfc1867.c | 4 |
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)); |