From: Rasmus Lerdorf Date: Fri, 8 Dec 2000 14:28:14 +0000 (+0000) Subject: Fix off by one error in file upload code X-Git-Tag: php-4.0.5RC1~958 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c9f1fe638d98ff67c365d886c7308f4a423ec9bc;p=php Fix off by one error in file upload code --- diff --git a/main/rfc1867.c b/main/rfc1867.c index 8c84c80010..40567f3507 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -182,7 +182,7 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr S if (lbuf) { efree(lbuf); } - lbuf = emalloc(s-name + MAX_SIZE_OF_INDEX); + lbuf = emalloc(s-name + MAX_SIZE_OF_INDEX + 1); state = 2; loc2 = memchr(loc + 1, '\n', rem); rem -= (loc2 - ptr) + 1;