From dbfe1a14e44647a4d5f27f8d495f3468208d75dd Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 2 Apr 2019 10:41:12 -0400 Subject: When parsing a multiline controller command, be careful with linebreaks The first line break in particular was mishandled: it was discarded if no arguments came before it, which made it impossible to distinguish arguments from the first line of the body. To solve this, we need to allocate a copy of the command rather than using NUL to separate it, since we might have "COMMAND\n" as our input. Fixes ticket 29984. --- src/feature/control/control_connection_st.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/feature/control/control_connection_st.h') diff --git a/src/feature/control/control_connection_st.h b/src/feature/control/control_connection_st.h index 177a916257..cace6bb36f 100644 --- a/src/feature/control/control_connection_st.h +++ b/src/feature/control/control_connection_st.h @@ -40,7 +40,8 @@ struct control_connection_t { /** A control command that we're reading from the inbuf, but which has not * yet arrived completely. */ char *incoming_cmd; + /** The control command that we are currently processing. */ + char *current_cmd; }; #endif - -- cgit v1.2.3-54-g00ecf