Index: apprentice.c =================================================================== RCS file: /home/ncvs/src/contrib/file/apprentice.c,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 apprentice.c --- apprentice.c 21 Jun 2006 09:28:00 -0000 1.1.1.11 +++ apprentice.c 16 Aug 2006 04:05:26 -0000 @@ -892,8 +892,10 @@ m->nospflag = 1; } else m->nospflag = 0; - while ((m->desc[i++] = *l++) != '\0' && i < MAXDESC) + while ((m->desc[i++] = *l++) != '\0' && i < MAXDESC - 1) /* NULLBODY */; + /* make sure to terminate the string */ + m->desc[i] = '\0'; if (ms->flags & MAGIC_CHECK) { if (!check_format(ms, m))