From: Stefan Esser Date: Wed, 12 Nov 2003 22:34:34 +0000 (+0000) Subject: Fix odd increments to repair the boundary checks. X-Git-Tag: php-4.3.5RC1~211 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e58611c0c7af7ac4464129ac7c7ece47be453017;p=php Fix odd increments to repair the boundary checks. --- diff --git a/main/rfc1867.c b/main/rfc1867.c index ae24be38b4..398b75598d 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -72,6 +72,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));