Print this page
10144 BZ2_bzDecompressReset() gets NULL check wrong


 656    strm->total_in_lo32      = 0;
 657    strm->total_in_hi32      = 0;
 658    strm->total_out_lo32     = 0;
 659    strm->total_out_hi32     = 0;
 660    s->smallDecompress       = (Bool)small;
 661    s->ll4                   = NULL;
 662    s->ll16                  = NULL;
 663    s->tt                    = NULL;
 664    s->currBlockNo           = 0;
 665    s->verbosity             = verbosity;
 666 
 667    return BZ_OK;
 668 }
 669 
 670 /*---------------------------------------------------*/
 671 /*
 672  * added to allow reuse of bz_stream without malloc/free
 673  */
 674 int BZ_API(BZ2_bzDecompressReset) ( bz_stream* strm )
 675 {
 676    DState* s = strm->state;
 677 
 678    if (!bz_config_ok()) return BZ_CONFIG_ERROR;
 679 
 680    if (strm == NULL) return BZ_PARAM_ERROR;
 681 

 682    s->strm                  = strm;
 683 
 684    s->state                 = BZ_X_MAGIC_1;
 685    s->bsLive                = 0;
 686    s->bsBuff                = 0;
 687    s->calculatedCombinedCRC = 0;
 688    strm->total_in_lo32      = 0;
 689    strm->total_in_hi32      = 0;
 690    strm->total_out_lo32     = 0;
 691    strm->total_out_hi32     = 0;
 692 
 693    s->ll4                   = NULL;
 694    s->ll16                  = NULL;
 695    s->tt                    = NULL;
 696    s->currBlockNo           = 0;
 697 
 698 
 699    return BZ_OK;
 700 }
 701 




 656    strm->total_in_lo32      = 0;
 657    strm->total_in_hi32      = 0;
 658    strm->total_out_lo32     = 0;
 659    strm->total_out_hi32     = 0;
 660    s->smallDecompress       = (Bool)small;
 661    s->ll4                   = NULL;
 662    s->ll16                  = NULL;
 663    s->tt                    = NULL;
 664    s->currBlockNo           = 0;
 665    s->verbosity             = verbosity;
 666 
 667    return BZ_OK;
 668 }
 669 
 670 /*---------------------------------------------------*/
 671 /*
 672  * added to allow reuse of bz_stream without malloc/free
 673  */
 674 int BZ_API(BZ2_bzDecompressReset) ( bz_stream* strm )
 675 {
 676    DState* s;
 677 
 678    if (!bz_config_ok()) return BZ_CONFIG_ERROR;
 679 
 680    if (strm == NULL) return BZ_PARAM_ERROR;
 681 
 682    s = strm->state;
 683    s->strm                  = strm;
 684 
 685    s->state                 = BZ_X_MAGIC_1;
 686    s->bsLive                = 0;
 687    s->bsBuff                = 0;
 688    s->calculatedCombinedCRC = 0;
 689    strm->total_in_lo32      = 0;
 690    strm->total_in_hi32      = 0;
 691    strm->total_out_lo32     = 0;
 692    strm->total_out_hi32     = 0;
 693 
 694    s->ll4                   = NULL;
 695    s->ll16                  = NULL;
 696    s->tt                    = NULL;
 697    s->currBlockNo           = 0;
 698 
 699 
 700    return BZ_OK;
 701 }
 702