]> git.ipfire.org Git - thirdparty/zstd.git/commit
fixed a bug in zstreamtest
authorYann Collet <cyan@fb.com>
Wed, 27 Sep 2017 07:39:41 +0000 (00:39 -0700)
committerYann Collet <cyan@fb.com>
Wed, 27 Sep 2017 07:39:41 +0000 (00:39 -0700)
commitca306c1c84df962fbfc066cdba8b6d409f20e3c2
tree9732ad944e4d14fac8595c3a3be237351e6d2fbf
parentcd53ac831b833790aa4b216379387ad0faa34223
fixed a bug in zstreamtest

decoder output buffer would receive a wrong size.

In previous version, ZSTD_decompressStream() would blindly trust the caller that pos <= size.
In this version, this condition is actively checked,
and the function returns an error code if this condition is not respected.

This check could also be done with an assert(),
but since this is a user-facing interface, it seems better to keep this check at runtime.
lib/decompress/zstd_decompress.c
tests/zstreamtest.c