Skip to content

Commit f2ef201

Browse files
p0pr0ck5zimmerle
authored andcommitted
Fix file upload JSON audit log entry
Each uploaded file is a separate yajl array, but we forgot to open the a map for the proper k/v pairs. This fixes issue #1173.
1 parent a2bb610 commit f2ef201

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

apache2/msc_logging.c

+2
Original file line numberDiff line numberDiff line change
@@ -1364,10 +1364,12 @@ void sec_audit_logger_json(modsec_rec *msr) {
13641364
for(cfiles = 0; cfiles < msr->mpd->parts->nelts; cfiles++) {
13651365
if (parts[cfiles]->type == MULTIPART_FILE) {
13661366
if(parts[cfiles]->filename != NULL) {
1367+
yajl_gen_map_open(g);
13671368
yajl_kv_int(g, "file_size", parts[cfiles]->tmp_file_size);
13681369
yajl_kv_string(g, "file_name", log_escape(msr->mp, parts[cfiles]->filename));
13691370
yajl_kv_string(g, "content_type", parts[cfiles]->content_type ? parts[cfiles]->content_type : "<Unknown Content-Type>");
13701371
total_size += parts[cfiles]->tmp_file_size;
1372+
yajl_gen_map_close(g);
13711373
}
13721374
}
13731375
}

0 commit comments

Comments
 (0)