Skip to content

Commit

Permalink
Add LOG4CXX_CHAR=wchar_t with clang GitHub action (#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
swebb2066 authored Feb 2, 2025
1 parent 24de478 commit f2eb65a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/log4cxx-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
multithread: OFF
exitevents: OFF
fuzzers: OFF
logchar: utf-8
- name: ubuntu20-clang
os: ubuntu-20.04
cxx: clang++
Expand All @@ -46,6 +47,7 @@ jobs:
multithread: OFF
exitevents: OFF
fuzzers: ON
logchar: utf-8
- name: ubuntu22-gcc
os: ubuntu-22.04
cxx: g++
Expand All @@ -56,6 +58,7 @@ jobs:
multithread: ON
exitevents: ON
fuzzers: OFF
logchar: utf-8
- name: ubuntu22-clang
os: ubuntu-22.04
cxx: clang++
Expand All @@ -66,6 +69,7 @@ jobs:
multithread: ON
exitevents: OFF
fuzzers: ON
logchar: wchar_t

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -103,6 +107,7 @@ jobs:
-DLOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER=${{ matrix.multiprocess }} \
-DLOG4CXX_EVENTS_AT_EXIT=${{ matrix.exitevents }} \
-DBUILD_FUZZERS=${{ matrix.fuzzers }} \
-DLOG4CXX_CHAR=${{ matrix.logchar }} \
..
cmake --build .
Expand Down
2 changes: 1 addition & 1 deletion src/fuzzers/cpp/TimeBasedRollingPolicyFuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
} else {
tbrp->setFileNamePattern(LogString(LOG4CXX_STR("fuzz-%d{" DATE_PATTERN "}.zip")));
}
rfa->setFile(LOG4CXX_STR(LOG4CXX_STR("test.log")));
rfa->setFile(LOG4CXX_STR("test.log"));

tbrp->activateOptions(pool);
rfa->setRollingPolicy(tbrp);
Expand Down
3 changes: 2 additions & 1 deletion src/main/cpp/syslogappender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,9 @@ void SyslogAppender::append(const spi::LoggingEventPtr& event, Pool& p)
for (auto const& item : packets)
{
// use of "%s" to avoid a security hole
LOG4CXX_ENCODE_CHAR(itemStr, item);
::syslog(_priv->syslogFacility | event->getLevel()->getSyslogEquivalent(),
"%s", item.c_str());
"%s", itemStr.c_str());
}

return;
Expand Down

0 comments on commit f2eb65a

Please sign in to comment.