use strlcpy, from openbsd
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12050 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -251,11 +251,12 @@ getent(char **cap, size_t *len, char **db_array, int fd,
|
||||
* Check if we have a top record from cgetset().
|
||||
*/
|
||||
if (depth == 0 && toprec != NULL && cgetmatch(toprec, name) == 0) {
|
||||
if ((record = malloc (topreclen + BFRAG)) == NULL) {
|
||||
size_t len = topreclen + BFRAG;
|
||||
if ((record = malloc (len)) == NULL) {
|
||||
errno = ENOMEM;
|
||||
return (-2);
|
||||
}
|
||||
(void)strcpy(record, toprec); /* XXX: strcpy is safe */
|
||||
(void)strlcpy(record, toprec, len);
|
||||
db_p = db_array;
|
||||
rp = record + topreclen + 1;
|
||||
r_end = rp + BFRAG;
|
||||
|
Reference in New Issue
Block a user