Print this page
10144 BZ2_bzDecompressReset() gets NULL check wrong

Split Close
Expand all
Collapse all
          --- old/usr/src/common/bzip2/bzlib.c
          +++ new/usr/src/common/bzip2/bzlib.c
↓ open down ↓ 665 lines elided ↑ open up ↑
 666  666  
 667  667     return BZ_OK;
 668  668  }
 669  669  
 670  670  /*---------------------------------------------------*/
 671  671  /*
 672  672   * added to allow reuse of bz_stream without malloc/free
 673  673   */
 674  674  int BZ_API(BZ2_bzDecompressReset) ( bz_stream* strm )
 675  675  {
 676      -   DState* s = strm->state;
      676 +   DState* s;
 677  677  
 678  678     if (!bz_config_ok()) return BZ_CONFIG_ERROR;
 679  679  
 680  680     if (strm == NULL) return BZ_PARAM_ERROR;
 681  681  
      682 +   s = strm->state;
 682  683     s->strm                  = strm;
 683  684  
 684  685     s->state                 = BZ_X_MAGIC_1;
 685  686     s->bsLive                = 0;
 686  687     s->bsBuff                = 0;
 687  688     s->calculatedCombinedCRC = 0;
 688  689     strm->total_in_lo32      = 0;
 689  690     strm->total_in_hi32      = 0;
 690  691     strm->total_out_lo32     = 0;
 691  692     strm->total_out_hi32     = 0;
↓ open down ↓ 1057 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX