Skip to content

Commit

Permalink
read_dylink_0_section: fix a buffer overrun
Browse files Browse the repository at this point in the history
found by examples/fuzz
  • Loading branch information
yamt committed Jun 17, 2024
1 parent f062da6 commit d6a64b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,12 @@ read_dylink_0_section(const uint8_t **pp, const uint8_t *ep,
if (ret != 0) {
goto fail;
}
if (ep - p < payload_len) {
ret = E2BIG;
goto fail;
}
const uint8_t *sep = p + payload_len;
assert(sep <= ep);
unsigned int i;
for (i = 0; i < ARRAYCOUNT(dylink_subsections); i++) {
const struct dylink_subsection *ss =
Expand Down

0 comments on commit d6a64b8

Please sign in to comment.