mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
646 B

  1. Taken from file-4.17-2.fc5.src.rpm (file-4.17-init-mem.patch).
  2. --- file-4.17/src/apprentice.c
  3. +++ file-4.17/src/apprentice.c
  4. @@ -380,8 +380,8 @@ apprentice_file(struct magic_set *ms, st
  5. return -1;
  6. }
  7. - maxmagic = MAXMAGIS;
  8. - if ((marray = malloc(maxmagic * sizeof(*marray))) == NULL) {
  9. + maxmagic = MAXMAGIS;
  10. + if ((marray = calloc(maxmagic, sizeof(*marray))) == NULL) {
  11. (void)fclose(f);
  12. file_oomem(ms);
  13. return -1;
  14. @@ -509,7 +509,7 @@ parse(struct magic_set *ms, struct magic
  15. char *t;
  16. private const char *fops = FILE_OPS;
  17. uint32_t val;
  18. - uint32_t cont_level, cont_count;
  19. + uint32_t cont_level;
  20. cont_level = 0;