Terminate cwd buffer before running xstrdup on it.

pull/1/head
Nicholas Marriott 2009-06-05 11:14:13 +00:00
parent 18665b8cc9
commit 89262c62fe
1 changed files with 1 additions and 0 deletions

View File

@ -196,6 +196,7 @@ server_msg_fn_identify(struct hdr *hdr, struct client *c)
c->tty.sy = data.sy;
c->cwd = NULL;
data.cwd[(sizeof data.cwd) - 1] = '\0';
if (*data.cwd != '\0')
c->cwd = xstrdup(data.cwd);