mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
Terminate cwd buffer before running xstrdup on it.
This commit is contained in:
@ -196,6 +196,7 @@ server_msg_fn_identify(struct hdr *hdr, struct client *c)
|
|||||||
c->tty.sy = data.sy;
|
c->tty.sy = data.sy;
|
||||||
|
|
||||||
c->cwd = NULL;
|
c->cwd = NULL;
|
||||||
|
data.cwd[(sizeof data.cwd) - 1] = '\0';
|
||||||
if (*data.cwd != '\0')
|
if (*data.cwd != '\0')
|
||||||
c->cwd = xstrdup(data.cwd);
|
c->cwd = xstrdup(data.cwd);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user