[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-bugs] #3428 [Tor Client]: Control port may emit log messages in the middle of another event/reply
#3428: Control port may emit log messages in the middle of another event/reply
------------------------+---------------------------------------------------
Reporter: rransom | Owner: rransom
Type: defect | Status: new
Priority: normal | Milestone: Tor: 0.2.3.x-final
Component: Tor Client | Version:
Keywords: | Parent:
Points: | Actualpoints:
------------------------+---------------------------------------------------
If the following call to `connection_printf_to_buf` in
`handle_control_getinfo` in src/or/control.c fails, it may emit a `LOG`
control-port event in the middle of a reply:
{{{
if (!strchr(v, '\n') && !strchr(v, '\r')) {
connection_printf_to_buf(conn, "250-%s=", k);
connection_write_str_to_buf(v, conn);
connection_write_str_to_buf("\r\n", conn);
} else {
}}}
I expect that other output functions can emit log messages in the middle
of a control port event or reply, too. We should make sure that never
happens, by making all control-port code build each complete reply/event
in a separate buffer before writing any of it out, and adding an
event/reply queue to the `control_connection_t` structure.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/3428>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs