0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 16:52:44 +01:00

server: Use rb_strlcpy() instead of strcpy().

An overflow should be impossible here, but be paranoid.
This commit is contained in:
Jilles Tjoelker 2014-02-24 00:04:11 +01:00
parent 26c6ac3dc7
commit a1f7ec5be0

View file

@ -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;