Avoid use of min-macro, as it is not available in all envs

This commit is contained in:
Allan Boll 2017-08-29 23:22:04 -07:00 committed by Felipe Zimmerle
parent 7fff8938ba
commit 2e9ea0a677
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277

View File

@ -435,7 +435,7 @@ apr_status_t modsecurity_request_body_to_stream(modsec_rec *msr, const char *buf
// Is the request body length known beforehand? (requests that are not Transfer-Encoding: chunked)
if (msr->request_content_length > 0) {
// Use min of Content-Length and SecRequestBodyLimit
allocate_length = min(msr->request_content_length, msr->txcfg->reqbody_limit);
allocate_length = msr->request_content_length < msr->txcfg->reqbody_limit ? msr->request_content_length : msr->txcfg->reqbody_limit;
}
else {
// We don't know how this request is going to be, so hope for just buflen to begin with (requests that are Transfer-Encoding: chunked)