From cddd9a7eb5585a9b3be1f9bdcadcace8f60f5808 Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Tue, 3 Sep 2024 21:49:43 +0200 Subject: [PATCH 1/2] Fix build error if -Werror=format-security is presented --- apache2/re.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apache2/re.c b/apache2/re.c index 82eba8f2..0a8b0724 100644 --- a/apache2/re.c +++ b/apache2/re.c @@ -472,8 +472,8 @@ char *update_rule_target_ex(modsec_rec *msr, msre_ruleset *ruleset, msre_rule *r end: if (my_error_msg) { - if (msr) msr_log(msr, 9, my_error_msg); - else ap_log_error(APLOG_MARK, APLOG_INFO, 0, NULL, my_error_msg); + if (msr) msr_log(msr, 9, "%s", my_error_msg); + else ap_log_error(APLOG_MARK, APLOG_INFO, 0, NULL, "%s", my_error_msg); } if (target_list != NULL) free(target_list); if (replace != NULL) free(replace); From 38e812d1970bac8434b6206b41f7b8109db245c5 Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Tue, 3 Sep 2024 21:50:22 +0200 Subject: [PATCH 2/2] Add -Werror=format-security CFLAG for all build case --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85e944f4..5e625415 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: - name: autogen.sh run: ./autogen.sh - name: configure ${{ matrix.configure.label }} - run: ./configure --enable-assertions ${{ matrix.configure.opt }} + run: ./configure --enable-assertions ${{ matrix.configure.opt }} 'CFLAGS=-Werror=format-security' - uses: ammaraskar/gcc-problem-matcher@master - name: make run: make -j `nproc`