diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-01-25 19:12:00 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-01-25 19:12:00 +0100 |
commit | d0a35eb15b2d1f45bce8edbf6351e636740ea2be (patch) | |
tree | dc296b7900625b3b210f9d06d6cd1b37ab3bd5f6 | |
parent | 162e0a0d2f6cbbf747c91876a213451c08a59e72 (diff) | |
download | applause2-d0a35eb15b2d1f45bce8edbf6351e636740ea2be.tar.gz |
fixed command server: unterminated string
-rw-r--r-- | applause.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); |