The source strings are from the password database which guarantees
that the data going into it is sane. Out of an abundance of caution, limit the string copies to prevent an overflow. CID: 1019035
This commit is contained in:
parent
9b8c88f693
commit
c92659280b
@ -457,8 +457,8 @@ iruserok_sa(const void *ra, int rlen, int superuser, const char *ruser,
|
||||
first = 0;
|
||||
if ((pwd = getpwnam(luser)) == NULL)
|
||||
return (-1);
|
||||
(void)strcpy(pbuf, pwd->pw_dir);
|
||||
(void)strcat(pbuf, "/.rhosts");
|
||||
(void)strlcpy(pbuf, pwd->pw_dir, sizeof(pbuf));
|
||||
(void)strlcat(pbuf, "/.rhosts", sizeof(pbuf));
|
||||
|
||||
/*
|
||||
* Change effective uid while opening .rhosts. If root and
|
||||
|
Loading…
Reference in New Issue
Block a user