This is an automated email from the ASF dual-hosted git repository.
bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 7f6f69775e Fix null pointer dereference in traffic_crashlog (#12756)
7f6f69775e is described below
commit 7f6f69775eeddc9211e3ab3b0cad9f4ad25869bd
Author: Bryan Call <[email protected]>
AuthorDate: Mon Dec 15 14:27:26 2025 -0800
Fix null pointer dereference in traffic_crashlog (#12756)
ServerBacktrace() can return 0 (success) but leave the trace pointer
null when the target process has already exited. This caused a SEGV
when fprintf() was called with the null trace pointer.
Add a null check before using the trace pointer.
---
src/traffic_crashlog/traffic_crashlog.cc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/traffic_crashlog/traffic_crashlog.cc
b/src/traffic_crashlog/traffic_crashlog.cc
index 65eee7bc50..9354c5f838 100644
--- a/src/traffic_crashlog/traffic_crashlog.cc
+++ b/src/traffic_crashlog/traffic_crashlog.cc
@@ -109,6 +109,11 @@ crashlog_write_backtrace(FILE *fp, pid_t pid, const
crashlog_target &)
return false;
}
+ if (trace == nullptr) {
+ fprintf(fp, "Unable to retrieve backtrace: trace is null\n");
+ return false;
+ }
+
fprintf(fp, "%s", trace);
free(trace);
return true;