mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-10-08 23:32:27 +03:00
Fix some sprintf formatters so they do not generate warnings.
This commit is contained in:
@@ -216,7 +216,7 @@ apr_status_t read_request_body(modsec_rec *msr, char **error_msg) {
|
|||||||
/* Check request body limit (should only trigger on chunked requests). */
|
/* Check request body limit (should only trigger on chunked requests). */
|
||||||
if (msr->reqbody_length + buflen > (apr_size_t)msr->txcfg->reqbody_limit) {
|
if (msr->reqbody_length + buflen > (apr_size_t)msr->txcfg->reqbody_limit) {
|
||||||
*error_msg = apr_psprintf(msr->mp, "Requests body is larger than the "
|
*error_msg = apr_psprintf(msr->mp, "Requests body is larger than the "
|
||||||
"configured limit (%lu).", msr->txcfg->reqbody_limit);
|
"configured limit (%ld).", msr->txcfg->reqbody_limit);
|
||||||
return -5;
|
return -5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,7 +225,7 @@ apr_status_t read_request_body(modsec_rec *msr, char **error_msg) {
|
|||||||
if (rcbs < 0) {
|
if (rcbs < 0) {
|
||||||
if (rcbs == -5) {
|
if (rcbs == -5) {
|
||||||
*error_msg = apr_psprintf(msr->mp, "Requests body no files data length is larger than the "
|
*error_msg = apr_psprintf(msr->mp, "Requests body no files data length is larger than the "
|
||||||
"configured limit (%lu).", msr->txcfg->reqbody_no_files_limit);
|
"configured limit (%ld).", msr->txcfg->reqbody_no_files_limit);
|
||||||
return -5;
|
return -5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -378,7 +378,7 @@ static apr_status_t output_filter_init(modsec_rec *msr, ap_filter_t *f,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (len > msr->txcfg->of_limit) {
|
if (len > msr->txcfg->of_limit) {
|
||||||
msr_log(msr, 1, "Output filter: Content-Length (%s) over the limit (%lu).",
|
msr_log(msr, 1, "Output filter: Content-Length (%s) over the limit (%ld).",
|
||||||
log_escape_nq(r->pool, (char *)s_content_length), msr->txcfg->of_limit);
|
log_escape_nq(r->pool, (char *)s_content_length), msr->txcfg->of_limit);
|
||||||
return -2; /* Over the limit. */
|
return -2; /* Over the limit. */
|
||||||
}
|
}
|
||||||
@@ -621,7 +621,7 @@ apr_status_t output_filter(ap_filter_t *f, apr_bucket_brigade *bb_in) {
|
|||||||
*/
|
*/
|
||||||
if (msr->txcfg->of_limit_action == RESPONSE_BODY_LIMIT_ACTION_REJECT) {
|
if (msr->txcfg->of_limit_action == RESPONSE_BODY_LIMIT_ACTION_REJECT) {
|
||||||
/* Reject response. */
|
/* Reject response. */
|
||||||
msr_log(msr, 1, "Output filter: Response body too large (over limit of %lu, "
|
msr_log(msr, 1, "Output filter: Response body too large (over limit of %ld, "
|
||||||
"total not specified).", msr->txcfg->of_limit);
|
"total not specified).", msr->txcfg->of_limit);
|
||||||
|
|
||||||
msr->of_status = OF_STATUS_COMPLETE;
|
msr->of_status = OF_STATUS_COMPLETE;
|
||||||
@@ -635,7 +635,7 @@ apr_status_t output_filter(ap_filter_t *f, apr_bucket_brigade *bb_in) {
|
|||||||
msr->resbody_length = msr->txcfg->of_limit;
|
msr->resbody_length = msr->txcfg->of_limit;
|
||||||
|
|
||||||
if (msr->txcfg->debuglog_level >= 4) {
|
if (msr->txcfg->debuglog_level >= 4) {
|
||||||
msr_log(msr, 4, "Output filter: Processing partial response body (limit %lu)",
|
msr_log(msr, 4, "Output filter: Processing partial response body (limit %ld)",
|
||||||
msr->txcfg->of_limit);
|
msr->txcfg->of_limit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -565,7 +565,7 @@ static int hook_request_early(request_rec *r) {
|
|||||||
/* Check request body limit (should only trigger on non-chunked requests). */
|
/* Check request body limit (should only trigger on non-chunked requests). */
|
||||||
if (msr->request_content_length > msr->txcfg->reqbody_limit) {
|
if (msr->request_content_length > msr->txcfg->reqbody_limit) {
|
||||||
msr_log(msr, 1, "Request body is larger than the "
|
msr_log(msr, 1, "Request body is larger than the "
|
||||||
"configured limit (%lu).", msr->txcfg->reqbody_limit);
|
"configured limit (%ld).", msr->txcfg->reqbody_limit);
|
||||||
return HTTP_REQUEST_ENTITY_TOO_LARGE;
|
return HTTP_REQUEST_ENTITY_TOO_LARGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -445,7 +445,7 @@ apr_status_t modsecurity_request_body_end(modsec_rec *msr, char **error_msg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Note the request body no files length. */
|
/* Note the request body no files length. */
|
||||||
msr_log(msr, 4, "Reqest body no files length: %lu", msr->msc_reqbody_no_files_length);
|
msr_log(msr, 4, "Reqest body no files length: %" APR_SIZE_T_FMT, msr->msc_reqbody_no_files_length);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@@ -778,7 +778,7 @@ apr_status_t msre_ruleset_process_phase(msre_ruleset *ruleset, modsec_rec *msr)
|
|||||||
rules = (msre_rule **)arr->elts;
|
rules = (msre_rule **)arr->elts;
|
||||||
for (i = 0; i < arr->nelts; i++) {
|
for (i = 0; i < arr->nelts; i++) {
|
||||||
msre_rule *rule = rules[i];
|
msre_rule *rule = rules[i];
|
||||||
msr_log(msr, 1, "Rule %pp [id \"%s\"][file \"%s\"][line \"%d\"]: %lu usec", rule,
|
msr_log(msr, 1, "Rule %pp [id \"%s\"][file \"%s\"][line \"%d\"]: %u usec", rule,
|
||||||
((rule->actionset != NULL)&&(rule->actionset->id != NULL)) ? rule->actionset->id : "-",
|
((rule->actionset != NULL)&&(rule->actionset->id != NULL)) ? rule->actionset->id : "-",
|
||||||
rule->filename != NULL ? rule->filename : "-",
|
rule->filename != NULL ? rule->filename : "-",
|
||||||
rule->line_num,
|
rule->line_num,
|
||||||
|
Reference in New Issue
Block a user