mirror of
https://github.com/intel/isa-l.git
synced 2025-03-03 04:38:38 +01:00
igzip: Fix underflow bugs whe null pointer is passed in igzip base functions
Change-Id: Ia24326dcde6f8be9ee019690b8206d2779ddebb2 Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
This commit is contained in:
parent
7c7272e89c
commit
f2c35a9fd4
@ -45,7 +45,7 @@ void isal_deflate_body_base(struct isal_zstream *stream)
|
|||||||
end_in = start_in + stream->avail_in;
|
end_in = start_in + stream->avail_in;
|
||||||
next_in = start_in;
|
next_in = start_in;
|
||||||
|
|
||||||
while (next_in < end_in - ISAL_LOOK_AHEAD) {
|
while (next_in + ISAL_LOOK_AHEAD < end_in) {
|
||||||
|
|
||||||
if (is_full(&state->bitbuf)) {
|
if (is_full(&state->bitbuf)) {
|
||||||
update_state(stream, start_in, next_in, end_in);
|
update_state(stream, start_in, next_in, end_in);
|
||||||
@ -125,7 +125,7 @@ void isal_deflate_finish_base(struct isal_zstream *stream)
|
|||||||
end_in = start_in + stream->avail_in;
|
end_in = start_in + stream->avail_in;
|
||||||
next_in = start_in;
|
next_in = start_in;
|
||||||
|
|
||||||
while (next_in < end_in - 3) {
|
while (next_in + 3 < end_in) {
|
||||||
if (is_full(&state->bitbuf)) {
|
if (is_full(&state->bitbuf)) {
|
||||||
update_state(stream, start_in, next_in, end_in);
|
update_state(stream, start_in, next_in, end_in);
|
||||||
return;
|
return;
|
||||||
|
@ -53,7 +53,7 @@ void isal_deflate_icf_body_base(struct isal_zstream *stream)
|
|||||||
sizeof(struct deflate_icf);
|
sizeof(struct deflate_icf);
|
||||||
next_out = start_out;
|
next_out = start_out;
|
||||||
|
|
||||||
while (next_in < end_in - ISAL_LOOK_AHEAD) {
|
while (next_in + ISAL_LOOK_AHEAD < end_in) {
|
||||||
|
|
||||||
if (next_out >= end_out) {
|
if (next_out >= end_out) {
|
||||||
state->state = ZSTATE_CREATE_HDR;
|
state->state = ZSTATE_CREATE_HDR;
|
||||||
@ -140,7 +140,7 @@ void isal_deflate_icf_finish_base(struct isal_zstream *stream)
|
|||||||
sizeof(struct deflate_icf);
|
sizeof(struct deflate_icf);
|
||||||
next_out = start_out;
|
next_out = start_out;
|
||||||
|
|
||||||
while (next_in < end_in - 3) {
|
while (next_in + 3 < end_in) {
|
||||||
if (next_out >= end_out) {
|
if (next_out >= end_out) {
|
||||||
state->state = ZSTATE_CREATE_HDR;
|
state->state = ZSTATE_CREATE_HDR;
|
||||||
update_state(stream, start_in, next_in, end_in, start_out, next_out,
|
update_state(stream, start_in, next_in, end_in, start_out, next_out,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user