Fix segfault when '/etc/malloc.conf@ -> AJ' due to differnce between
calloc & malloc as agreed by vendor. Also remove an unused variable.
This commit is contained in:
parent
88a5e5ac7b
commit
dbca37326f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor/file/dist/; revision=159825
@ -380,8 +380,8 @@ apprentice_file(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
maxmagic = MAXMAGIS;
|
maxmagic = MAXMAGIS;
|
||||||
if ((marray = malloc(maxmagic * sizeof(*marray))) == NULL) {
|
if ((marray = calloc(maxmagic, sizeof(*marray))) == NULL) {
|
||||||
(void)fclose(f);
|
(void)fclose(f);
|
||||||
file_oomem(ms);
|
file_oomem(ms);
|
||||||
return -1;
|
return -1;
|
||||||
@ -509,7 +509,7 @@ parse(struct magic_set *ms, struct magic_entry **mentryp, uint32_t *nmentryp,
|
|||||||
char *t;
|
char *t;
|
||||||
private const char *fops = FILE_OPS;
|
private const char *fops = FILE_OPS;
|
||||||
uint32_t val;
|
uint32_t val;
|
||||||
uint32_t cont_level, cont_count;
|
uint32_t cont_level;
|
||||||
|
|
||||||
cont_level = 0;
|
cont_level = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user