mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
server: don't get stuck in read() if TERM length is 0
This commit is contained in:
parent
a1ba4cb010
commit
338747dc5a
1 changed files with 4 additions and 2 deletions
6
server.c
6
server.c
|
|
@ -113,8 +113,10 @@ fdm_client(struct fdm *fdm, int fd, int events, void *data)
|
|||
|
||||
term_env = malloc(term_env_len + 1);
|
||||
term_env[term_env_len] = '\0';
|
||||
if (recv(fd, term_env, term_env_len, 0) != term_env_len)
|
||||
goto shutdown;
|
||||
if (term_env_len > 0) {
|
||||
if (recv(fd, term_env, term_env_len, 0) != term_env_len)
|
||||
goto shutdown;
|
||||
}
|
||||
|
||||
if (recv(fd, &client->argc, sizeof(client->argc), 0) != sizeof(client->argc))
|
||||
goto shutdown;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue