Skip to content
Permalink
Browse files Browse the repository at this point in the history
store mode: check for truncation
  • Loading branch information
kspalaiologos committed Mar 22, 2023
1 parent 8ec8ce7 commit bb06deb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libbz3.c
Expand Up @@ -620,7 +620,7 @@ BZIP3_API s32 bz3_decode_block(struct bz3_state * state, u8 * buffer, s32 data_s
}

if (bwt_idx == -1) {
if (data_size - 8 > 64) {
if (data_size - 8 > 64 || data_size < 8) {
state->last_error = BZ3_ERR_MALFORMED_HEADER;
return -1;
}
Expand Down

0 comments on commit bb06deb

Please sign in to comment.