Browse Source

Import Debian version 4.17-5

Michael Piefel 18 years ago
parent
commit
ef47a37f53
2 changed files with 2 additions and 0 deletions
  1. 1 0
      src/apprentice.c
  2. 1 0
      src/magic.c

+ 1 - 0
src/apprentice.c

@@ -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)

+ 1 - 0
src/magic.c

@@ -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;