mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Don't unnecessarily rename request body parts in cleanup
When tmp_dir and upload_dir are identical, there's no reason to rename multipart and request body parts, as this is a non-op. Let's save the cycles and syscall.
This commit is contained in:
committed by
Felipe Zimmerle
parent
8559dd3b8b
commit
709042a472
@@ -1327,6 +1327,11 @@ apr_status_t multipart_cleanup(modsec_rec *msr) {
|
||||
} else {
|
||||
/* Move file to the upload dir. */
|
||||
if (parts[i]->tmp_file_name != NULL) {
|
||||
if (strcmp(msr->txcfg->upload_dir, msr->txcfg->tmp_dir) == 0) {
|
||||
msr_log(msr, 4, "Not moving part to identical location");
|
||||
continue;
|
||||
}
|
||||
|
||||
const char *new_filename = NULL;
|
||||
const char *new_basename = NULL;
|
||||
|
||||
|
Reference in New Issue
Block a user