server: don't get stuck in read() if length of argv argument is 0

This commit is contained in:
Daniel Eklöf 2019-11-02 12:16:50 +01:00
parent 965d8a3a8e
commit a1ba4cb010
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -129,6 +129,9 @@ fdm_client(struct fdm *fdm, int fd, int events, void *data)
client->argv[i] = malloc(len + 1);
client->argv[i][len] = '\0';
if (len == 0)
continue;
if (recv(fd, client->argv[i], len, 0) != len)
goto shutdown;