Login
User Name:

Password:



Register

Forgot your password?
do_owhere recursive
Author: Khonsu
Submitted by: Khonsu
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
Users Online
AhrefsBot

Members: 0
Guests: 19
Stats
Files
Topics
Posts
Members
Newest Member
489
3,791
19,644
596
Elwood

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Bugfix Lists » SWR FUSS Bugfix List » [Bug] compressEnd doesn't han...
Forum Rules | Mark all | Recent Posts

[Bug] compressEnd doesn't handle itself very well
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Apr 21, 2010 5:20 am   
Go to the top of the page
Go to the bottom of the page

InfiniteAxis
Off the Edge of the Map
GroupAdministrators
Posts1,200
JoinedMar 21, 2006

 
Bug: compressEnd doesn't handle itself very well.
Danger: Medium - Could contribute to rare issue of compressed streams becoming corrupted.
Found by: Nick Gammon
Fixed by: Nick Gammon

---

mccp.c

Replace the compressEnd function with:

bool compressEnd( DESCRIPTOR_DATA * d )
{
   unsigned char dummy[1];

   if( !d->mccp->out_compress )
      return TRUE;

   d->mccp->out_compress->avail_in = 0;
   d->mccp->out_compress->next_in = dummy;

   if( deflate( d->mccp->out_compress, Z_FINISH ) == Z_STREAM_END )
      process_compressed( d );   /* try to send any residual data */

   deflateEnd( d->mccp->out_compress );
   DISPOSE( d->mccp->out_compress_buf );
   DISPOSE( d->mccp->out_compress );

   return TRUE;
}

Pages:<< prev 1 next >>