From d0a35eb15b2d1f45bce8edbf6351e636740ea2be Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 25 Jan 2016 19:12:00 +0100 Subject: fixed command server: unterminated string --- applause.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'applause.c') diff --git a/applause.c b/applause.c index 7ec50b8..8ceb182 100644 --- a/applause.c +++ b/applause.c @@ -824,7 +824,7 @@ command_server(void *user_data) /* parse message length */ length = atoi(length_buf); - command = malloc(length); + command = malloc(length+1); assert(command != NULL); if (read(client_fd, command, length) < length) { @@ -837,6 +837,7 @@ command_server(void *user_data) close(client_fd); continue; } + command[length] = '\0'; pthread_mutex_lock(&lua_mutex); -- cgit v1.2.3