From: Ilia Alshanetsky Date: Wed, 5 Mar 2003 17:00:09 +0000 (+0000) Subject: Fixed bug #22550 (overflow protection for upload_max_filesize ini setting). X-Git-Tag: RELEASE_0_5~599 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e6997ddf9529c149fe31e0f516872d1c6fdad32;p=php Fixed bug #22550 (overflow protection for upload_max_filesize ini setting). --- diff --git a/main/rfc1867.c b/main/rfc1867.c index 202dc8ee8d..457a0184e2 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -861,7 +861,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) while (!cancel_upload && (blen = multipart_buffer_read(mbuff, buff, sizeof(buff) TSRMLS_CC))) { - if (total_bytes > PG(upload_max_filesize)) { + if (PG(upload_max_filesize) > 0 && total_bytes > PG(upload_max_filesize)) { sapi_module.sapi_error(E_WARNING, "upload_max_filesize of %ld bytes exceeded - file [%s=%s] not saved", PG(upload_max_filesize), param, filename); cancel_upload = UPLOAD_ERROR_A; } else if (max_file_size && (total_bytes > max_file_size)) {