Proposed PR branch: qe/issue-04-logger-nul-termination
Category: Bug (potential memory disclosure / UB hardening)
Problem
- Logger path when
log_message() is called without extra args must guarantee
NUL termination to avoid undefined reads and garbage/log leakage.
Justification / why this is needed
- Unterminated strings can cause reads past the intended buffer, which is UB
and can leak memory contents into logs (a confidentiality concern).
- Logging code is often enabled during failures; that’s the worst time to risk
adding more instability or leaking unrelated memory.
Proposed change
- Guarantee NUL termination on the no-arg path.
- Add a regression test that would fail if truncation/untermination occurs.
Acceptance criteria
- Log strings are always NUL-terminated regardless of arg path.
- Regression test covers the fixed behavior.
Test plan
make test (expects tests/testDriver_logger_nul_termination.c to pass).
References
- Key files:
zdnn/logger.c, tests/testDriver_logger_nul_termination.c.
Proposed PR branch:
qe/issue-04-logger-nul-terminationCategory:
Bug(potential memory disclosure / UB hardening)Problem
log_message()is called without extra args must guaranteeNUL termination to avoid undefined reads and garbage/log leakage.
Justification / why this is needed
and can leak memory contents into logs (a confidentiality concern).
adding more instability or leaking unrelated memory.
Proposed change
Acceptance criteria
Test plan
make test(expectstests/testDriver_logger_nul_termination.cto pass).References
zdnn/logger.c,tests/testDriver_logger_nul_termination.c.