mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-04-12 18:40:23 +08:00
BR3392739: output/outbin: fix nil dereference for self following sections
In case if section follows itself we should yield an error, otherwise we hit nil dereference because there won't be any group of sections. After all "follow" attribute is rather to group sections other than self. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
79ac0d686d
commit
8c735c58d1
@ -335,6 +335,8 @@ static void bin_cleanup(void)
|
||||
if (!s)
|
||||
nasm_fatal("section %s follows an invalid or"
|
||||
" unknown section (%s)", g->name, g->follows);
|
||||
if (s == g)
|
||||
nasm_fatal("section %s is self following", s->name);
|
||||
if (s->next && (s->next->flags & FOLLOWS_DEFINED) &&
|
||||
!strcmp(s->name, s->next->follows))
|
||||
nasm_fatal("sections %s and %s can't both follow"
|
||||
|
Loading…
x
Reference in New Issue
Block a user