mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
server: don't get stuck in read() if length of argv argument is 0
This commit is contained in:
parent
965d8a3a8e
commit
a1ba4cb010
1 changed files with 3 additions and 0 deletions
3
server.c
3
server.c
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue