From a7bda49cd7812a0d808e761c5497f4fb2ee82a2e Mon Sep 17 00:00:00 2001 From: Martin Errenst Date: Sat, 28 Jul 2018 22:22:16 +0200 Subject: [PATCH] don't use strlen(), in case of random data, there's no \0 at the end... --- examples/telnet_echo/telnet_echo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/telnet_echo/telnet_echo.c b/examples/telnet_echo/telnet_echo.c index 5c0d6b0..4a90870 100644 --- a/examples/telnet_echo/telnet_echo.c +++ b/examples/telnet_echo/telnet_echo.c @@ -127,7 +127,7 @@ static void telnetTask(void *pvParameters) if(buffer_pos + data_len < sizeof(input_line)) { // copy data into input buffer if(data_len > 0){ - memcpy(&input_line[buffer_pos], (char*)data_in, strlen(data_in)); + memcpy(&input_line[buffer_pos], (char*)data_in, data_len); buffer_pos += data_len; // check for line ending if((data_len >= 2) &&