diff options
author | Pedro Martelletto <pedro@cvs.openbsd.org> | 2006-04-04 10:53:41 +0000 |
---|---|---|
committer | Pedro Martelletto <pedro@cvs.openbsd.org> | 2006-04-04 10:53:41 +0000 |
commit | 18436acaf74d2bbd384f21ae40c20515638b1fdb (patch) | |
tree | 9ceda25eeb43847baa9ff826d2a2c1f0fdd633e1 /usr.bin/file | |
parent | 718e4a5849a7ee6b1663586e05b37f894336b8a6 (diff) |
Fix case where a string could not be correctly terminated, okay jaredy@
Diffstat (limited to 'usr.bin/file')
-rw-r--r-- | usr.bin/file/apprentice.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/file/apprentice.c b/usr.bin/file/apprentice.c index 63fec5148fc..4214aec2cb0 100644 --- a/usr.bin/file/apprentice.c +++ b/usr.bin/file/apprentice.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apprentice.c,v 1.20 2004/09/25 09:19:35 otto Exp $ */ +/* $OpenBSD: apprentice.c,v 1.21 2006/04/04 10:53:40 pedro Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. * Software written by Ian F. Darwin and others; @@ -46,7 +46,7 @@ #endif #ifndef lint -FILE_RCSID("@(#)$Id: apprentice.c,v 1.20 2004/09/25 09:19:35 otto Exp $") +FILE_RCSID("@(#)$Id: apprentice.c,v 1.21 2006/04/04 10:53:40 pedro Exp $") #endif /* lint */ #define EATAB {while (isascii((unsigned char) *l) && \ @@ -698,8 +698,8 @@ GetDesc: m->nospflag = 1; } else m->nospflag = 0; - while ((m->desc[i++] = *l++) != '\0' && i < MAXDESC) - /* NULLBODY */; + + strlcpy(m->desc, l, sizeof(m->desc)); #ifndef COMPILE_ONLY if (action == FILE_CHECK) { |