diff --git a/src/syncterm/conn_telnet.c b/src/syncterm/conn_telnet.c
index df1f945d950e0df4478d983c2c2cedad51d892b0..d2eeee6fba6d41868515157e1d0c250613f60e9a 100644
--- a/src/syncterm/conn_telnet.c
+++ b/src/syncterm/conn_telnet.c
@@ -21,7 +21,8 @@ extern int	telnet_log_level;
 
 void *telnet_rx_parse_cb(const void *buf, size_t inlen, size_t *olen)
 {
-	void *ret = malloc(inlen);
+	// telnet_interpret() can add up to one byte to inbuf ('\r')
+	void *ret = malloc(inlen + 1);
 
 	if (ret == NULL)
 		return ret;