Skip to content

Commit

Permalink
Fixing same bug in the other two places it comes up
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuart Donnan authored and jd-boyd committed Nov 19, 2015
1 parent 0ae54de commit 874cc0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lzomodule.c
Expand Up @@ -168,7 +168,7 @@ decompress(PyObject *dummy, PyObject *args)
goto header_error;
in_len = len - 5;
out_len = (in[1] << 24) | (in[2] << 16) | (in[3] << 8) | in[4];
if ((int)out_len < 0 || in_len > out_len + out_len / 64 + 16 + 3)
if ((int)out_len < 0 || in_len > out_len + out_len / 16 + 64 + 3)
goto header_error;

/* alloc buffers */
Expand Down Expand Up @@ -224,7 +224,7 @@ optimize(PyObject *dummy, PyObject *args)
goto header_error;
in_len = len - 5;
out_len = (in[1] << 24) | (in[2] << 16) | (in[3] << 8) | in[4];
if ((int)out_len < 0 || in_len > out_len + out_len / 64 + 16 + 3)
if ((int)out_len < 0 || in_len > out_len + out_len / 16 + 64 + 3)
goto header_error;

/* alloc buffers */
Expand Down

0 comments on commit 874cc0c

Please sign in to comment.