Skip to content

Commit

Permalink
Allow dest size of 0 in block decompress (python#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanunderwood committed May 13, 2017
1 parent 1f49adf commit 94c8473
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lz4/block/_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ decompress (PyObject * Py_UNUSED (self), PyObject * args, PyObject * kwargs)
source_size -= hdr_size;
}

if (dest_size <= 0 || dest_size > PY_SSIZE_T_MAX)
if (dest_size < 0 || dest_size > PY_SSIZE_T_MAX)
{
PyErr_Format (PyExc_ValueError, "Invalid size in header: 0x%zu",
dest_size);
Expand Down

0 comments on commit 94c8473

Please sign in to comment.