Copilot commented on code in PR #13262:
URL: https://github.com/apache/trafficserver/pull/13262#discussion_r3690637965


##########
src/tscore/Diags.cc:
##########
@@ -433,6 +418,9 @@ Diags::error_va(DiagsLevel level, const SourceLocation 
*loc, const char *format_
     va_list ap2;
 
     va_copy(ap2, ap);
+    // No re-entry guard: if two threads emit a terminal-level message

Review Comment:
   Diags::error_va() calls print_va() with the incoming va_list and only then 
does va_copy(ap2, ap). If syslog output is enabled, print_va() consumes ap via 
vsnprintf(), so the copied ap2 may be invalid/advanced and the subsequent 
ink_fatal_va/ink_emergency_va formatting can misbehave (missing arguments / 
UB). Copy the va_list(s) up front and pass a copy into print_va(), keeping the 
original untouched for the terminal path.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to