Skip to content

Commit 80ce049

Browse files
Nick CliftonH. Peter Anvin (Intel)
authored andcommitted
outobj: fix buffer overflow when too many segments in a group
The number of entries in a group was hard-coded, but not enforced. Reported-by: <BreakingBad6@github.com> Fixes: #203 Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
1 parent c7e95b1 commit 80ce049

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

output/outobj.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,10 @@ obj_directive(enum directive directive, char *value)
17371737
*/
17381738
continue;
17391739
}
1740+
if (grp->nentries >= GROUP_MAX) {
1741+
nasm_nonfatal("too many segments in a group");
1742+
return DIRR_ERROR;
1743+
}
17401744
for (seg = seghead; seg; seg = seg->next)
17411745
if (!strcmp(seg->name, p))
17421746
break;

0 commit comments

Comments
 (0)