Skip to content

Commit

Permalink
Merge pull request #33 from occia/public
Browse files Browse the repository at this point in the history
fix oob write vulnerabilities inside libmobi
  • Loading branch information
bfabiszewski authored Sep 9, 2021
2 parents 983b898 + ab5bf0e commit 67b8a43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,8 @@ void mobi_buffer_move(MOBIBuffer *buf, const int offset, const size_t len) {
}
source += aoffset;
} else {
if (buf->offset < aoffset) {
debug_print("%s", "End of buffer\n");
if ( (buf->offset < aoffset) || (buf->offset + len > buf->maxlen) ) {
debug_print("%s", "Beyond start/end of buffer\n");
buf->error = MOBI_BUFFER_END;
return;
}
Expand Down

0 comments on commit 67b8a43

Please sign in to comment.