mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 16:43:11 +01:00
Terminate buffers properly.
This commit is contained in:
parent
5990461688
commit
4d6cfe5f22
@ -1,4 +1,4 @@
|
||||
/* $Id: server-fn.c,v 1.5 2007-09-27 10:09:37 nicm Exp $ */
|
||||
/* $Id: server-fn.c,v 1.6 2007-09-28 21:08:30 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -31,6 +31,7 @@ server_find_sessid(struct sessid *sid, char **cause)
|
||||
u_int i, n;
|
||||
|
||||
if (*sid->name != '\0') {
|
||||
sid->name[(sizeof sid->name) - 1] = '\0';
|
||||
if ((s = session_find(sid->name)) == NULL) {
|
||||
xasprintf(cause, "session not found: %s", sid->name);
|
||||
return (NULL);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: server-msg.c,v 1.5 2007-09-27 09:52:03 nicm Exp $ */
|
||||
/* $Id: server-msg.c,v 1.6 2007-09-28 21:08:30 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -112,6 +112,7 @@ server_msg_fn_new(struct hdr *hdr, struct client *c)
|
||||
if (c->sy == 0)
|
||||
c->sy = 25;
|
||||
|
||||
data.name[(sizeof data.name) - 1] = '\0';
|
||||
if (*data.name != '\0' && session_find(data.name) != NULL) {
|
||||
xasprintf(&msg, "duplicate session: %s", data.name);
|
||||
server_write_client(c, MSG_ERROR, msg, strlen(msg));
|
||||
|
Loading…
Reference in New Issue
Block a user