Print this page
10144 BZ2_bzDecompressReset() gets NULL check wrong
*** 671,686 ****
/*
* added to allow reuse of bz_stream without malloc/free
*/
int BZ_API(BZ2_bzDecompressReset) ( bz_stream* strm )
{
! DState* s = strm->state;
if (!bz_config_ok()) return BZ_CONFIG_ERROR;
if (strm == NULL) return BZ_PARAM_ERROR;
s->strm = strm;
s->state = BZ_X_MAGIC_1;
s->bsLive = 0;
s->bsBuff = 0;
--- 671,687 ----
/*
* added to allow reuse of bz_stream without malloc/free
*/
int BZ_API(BZ2_bzDecompressReset) ( bz_stream* strm )
{
! DState* s;
if (!bz_config_ok()) return BZ_CONFIG_ERROR;
if (strm == NULL) return BZ_PARAM_ERROR;
+ s = strm->state;
s->strm = strm;
s->state = BZ_X_MAGIC_1;
s->bsLive = 0;
s->bsBuff = 0;