int read_bytes;
int allocated_bytes=SAPI_POST_BLOCK_SIZE+1;
- if (SG(request_info).content_length > SG(post_max_size)) {
+ if ((SG(post_max_size) > 0) && (SG(request_info).content_length > SG(post_max_size))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "POST Content-Length of %ld bytes exceeds the limit of %ld bytes",
SG(request_info).content_length, SG(post_max_size));
return;
break;
}
SG(read_post_bytes) += read_bytes;
- if (SG(read_post_bytes) > SG(post_max_size)) {
+ if ((SG(post_max_size) > 0) && (SG(read_post_bytes) > SG(post_max_size))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Actual POST length does not match Content-Length, and exceeds %ld bytes", SG(post_max_size));
break;
}