Fixed bug #22550 (overflow protection for upload_max_filesize ini setting).

This commit is contained in:
Ilia Alshanetsky 2003-03-05 17:00:09 +00:00
parent 4f4f0a9771
commit 4e6997ddf9

View File

@ -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)) {