Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit966e7e1

Browse files
author
Felipe Zimmerle
committed
Adds verification before access the strcmp
Audit log was making the assumption that "arg->origin" was filled whichis not necessary true. This commit adds an verification.
1 parentc5c2690 commit966e7e1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎apache2/msc_logging.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static int sec_auditlog_write(modsec_rec *msr, const char *data, unsigned int le
5353

5454
msr_log(msr,1,"Audit log: Failed writing (requested %"APR_SIZE_T_FMT
5555
" bytes, written %"APR_SIZE_T_FMT"): %s",nbytes,nbytes_written,
56-
apr_strerror(rc,errstr,sizeof(errstr));
56+
apr_strerror(rc,errstr,sizeof(errstr)));
5757

5858
/* Concurrent log format: don't leak file handle. */
5959
if (msr->txcfg->auditlog_type==AUDITLOG_CONCURRENT) {
@@ -704,7 +704,9 @@ void sec_audit_logger(modsec_rec *msr) {
704704
telts= (constapr_table_entry_t*)tarr->elts;
705705
for(i=0;i<tarr->nelts;i++) {
706706
msc_arg*arg= (msc_arg*)telts[i].val;
707-
if (strcmp(arg->origin,"BODY")!=0)continue;
707+
if (arg->origin!=NULL&&
708+
strcmp(arg->origin,"BODY")!=0)
709+
continue;
708710

709711
if (last_offset==0) {/* The first time we're here. */
710712
if (arg->value_origin_offset>offset) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp