mirror of
https://github.com/yasm/yasm
synced 2026-08-26 22:26:05 -04:00
elf.c: Fix NULL deref on bad xsize expression (#234)
This commit is contained in:
parent
4dc8c3bf03
commit
2cd3bb50e2
1 changed files with 5 additions and 5 deletions
|
|
@ -482,15 +482,15 @@ elf_symtab_write_to_file(FILE *f, elf_symtab_head *symtab,
|
|||
|
||||
/* get size (if specified); expr overrides stored integer */
|
||||
if (entry->xsize) {
|
||||
size_intn = yasm_intnum_copy(
|
||||
yasm_expr_get_intnum(&entry->xsize, 1));
|
||||
if (!size_intn) {
|
||||
yasm_intnum *intn = yasm_expr_get_intnum(&entry->xsize, 1);
|
||||
if (!intn) {
|
||||
yasm_error_set(YASM_ERROR_VALUE,
|
||||
N_("size specifier not an integer expression"));
|
||||
yasm_errwarn_propagate(errwarns, entry->xsize->line);
|
||||
}
|
||||
} else
|
||||
size_intn = yasm_intnum_copy(intn);
|
||||
}
|
||||
else
|
||||
if (!size_intn)
|
||||
size_intn = yasm_intnum_create_uint(entry->size);
|
||||
|
||||
/* get EQU value for constants */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue