Skip to content

Commit

Permalink
add r2007 Page out of bounds check
Browse files Browse the repository at this point in the history
Fixes case 1 of GH #179
  • Loading branch information
rurban committed Jan 3, 2020
1 parent 5c19f59 commit fc8c16c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/decode_r2007.c
Expand Up @@ -1010,6 +1010,13 @@ read_pages_map (Bit_Chain *dat, int64_t size_comp, int64_t size_uncomp,
pages_destroy (pages);
return NULL;
}
if (ptr + 16 > ptr_end)
{
LOG_ERROR ("Page out of bounds")
free (data);
pages_destroy (pages);
return NULL;
}

page->size = bfr_read_uint64 (ptr);
page->id = bfr_read_int64 (ptr);
Expand Down

0 comments on commit fc8c16c

Please sign in to comment.