@@ -387,6 +387,7 @@ apprentice_file(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
return -1;
}
marraycount = 0;
+ (void) memset((void *)marray, 0, maxmagic * sizeof(*marray));
/* print silly verbose header for USG compat. */
if (action == FILE_CHECK)
@@ -86,6 +86,7 @@ magic_open(int flags)
if ((ms = malloc(sizeof(struct magic_set))) == NULL)
return NULL;
+ (void) memset((void *)ms, 0, sizeof(struct magic_set));
if (magic_setflags(ms, flags) == -1) {
errno = EINVAL;