From a1f7ec5be0e1b6ddff9dbedec14485ef4377e9a1 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Mon, 24 Feb 2014 00:04:11 +0100 Subject: [PATCH] server: Use rb_strlcpy() instead of strcpy(). An overflow should be impossible here, but be paranoid. --- src/s_serv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/s_serv.c b/src/s_serv.c index 1efc7eb05..6bd4fcab5 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -1191,7 +1191,8 @@ serv_connect(struct server_conf *server_p, struct Client *by) make_server(client_p); if(by && IsPerson(by)) { - strcpy(client_p->serv->by, by->name); + rb_strlcpy(client_p->serv->by, by->name, + sizeof client_p->serv->by); if(client_p->serv->user) free_user(client_p->serv->user, NULL); client_p->serv->user = by->user; @@ -1199,7 +1200,8 @@ serv_connect(struct server_conf *server_p, struct Client *by) } else { - strcpy(client_p->serv->by, "AutoConn."); + rb_strlcpy(client_p->serv->by, "AutoConn.", + sizeof client_p->serv->by); if(client_p->serv->user) free_user(client_p->serv->user, NULL); client_p->serv->user = NULL;