+ * make sure that we nul terminate desc (Ryoji Kanai)
+
* don't process elf notes multiple times
* allow -z to report empty compressed files
#endif
#ifndef lint
-FILE_RCSID("@(#)$Id: apprentice.c,v 1.95 2006/06/08 22:48:51 christos Exp $")
+FILE_RCSID("@(#)$Id: apprentice.c,v 1.96 2006/10/27 14:51:28 christos Exp $")
#endif /* lint */
#define EATAB {while (isascii((unsigned char) *l) && \
m->nospflag = 1;
} else
m->nospflag = 0;
- for (i = 0; (m->desc[i++] = *l++) != '\0' && i < MAXDESC; )
+ for (i = 0; (m->desc[i++] = *l++) != '\0' && i < sizeof(m->desc); )
continue;
+ m->desc[sizeof(m->desc) - 1] = '\0';
/*
* We only do this check while compiling, or if any of the magic