diff options
author | obrien <obrien@FreeBSD.org> | 2003-02-28 05:19:36 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2003-02-28 05:19:36 +0000 |
commit | f35360c37203a2efe4238a8ec8dd5c45cde0820b (patch) | |
tree | 1705752f770500133cc84f6e74036f0089e1421d /contrib/file/apprentice.c | |
parent | 822cce384d16c9a63f80e0c0765717d4a329368d (diff) | |
download | FreeBSD-src-f35360c37203a2efe4238a8ec8dd5c45cde0820b.zip FreeBSD-src-f35360c37203a2efe4238a8ec8dd5c45cde0820b.tar.gz |
Virgin import of Christos Zoulas's FILE 3.41.
* - fix memory allocation problem (Jeff Johnson)
* - fix stack overflow corruption (David Endler)
Diffstat (limited to 'contrib/file/apprentice.c')
-rw-r--r-- | contrib/file/apprentice.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/file/apprentice.c b/contrib/file/apprentice.c index 522945d..575bad6 100644 --- a/contrib/file/apprentice.c +++ b/contrib/file/apprentice.c @@ -38,7 +38,7 @@ #endif #ifndef lint -FILE_RCSID("@(#)$Id: apprentice.c,v 1.49 2002/07/03 19:00:41 christos Exp $") +FILE_RCSID("@(#)$Id: apprentice.c,v 1.50 2003/02/27 20:47:46 christos Exp $") #endif /* lint */ #define EATAB {while (isascii((unsigned char) *l) && \ @@ -231,7 +231,7 @@ apprentice_file(struct magic **magicp, uint32_t *nmagicp, const char *fn, } maxmagic = MAXMAGIS; - *magicp = (struct magic *) calloc(sizeof(struct magic), maxmagic); + *magicp = (struct magic *) calloc(maxmagic, sizeof(struct magic)); if (*magicp == NULL) { (void) fprintf(stderr, "%s: Out of memory (%s).\n", progname, strerror(errno)); |