Skip to content

Commit

Permalink
fix oob write bug inside libmobi
Browse files Browse the repository at this point in the history
  • Loading branch information
occia committed Sep 9, 2021
1 parent 983b898 commit ab5bf0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/buffer.c
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 ab5bf0e

Please sign in to comment.