mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 16:34:13 +01:00
server: Use rb_strlcpy() instead of strcpy().
An overflow should be impossible here, but be paranoid.
This commit is contained in:
parent
26c6ac3dc7
commit
a1f7ec5be0
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue