diff options
Diffstat (limited to 'crypto/heimdal/lib/roken/getcap.c')
-rw-r--r-- | crypto/heimdal/lib/roken/getcap.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/heimdal/lib/roken/getcap.c b/crypto/heimdal/lib/roken/getcap.c index 997fabf..8a29e1f 100644 --- a/crypto/heimdal/lib/roken/getcap.c +++ b/crypto/heimdal/lib/roken/getcap.c @@ -40,7 +40,7 @@ #include <config.h> #endif #include "roken.h" -RCSID("$Id: getcap.c,v 1.7 1999/11/17 21:11:58 assar Exp $"); +RCSID("$Id: getcap.c,v 1.8 2003/04/16 16:23:36 lha Exp $"); #include <sys/types.h> #include <ctype.h> @@ -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; |