From: Stefan Esser Date: Wed, 12 Nov 2003 22:34:58 +0000 (+0000) Subject: Fix odd increments to repair the boundary checks. X-Git-Tag: php-5.0.0b3RC1~707 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=befbd6d793b22934f3b1e9b0570dd34f0c044acc;p=php Fix odd increments to repair the boundary checks. --- 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));