Changeset 4288


Ignore:
Timestamp:
Jan 21, 2010, 2:17:15 AM (8 years ago)
Author:
Sam Hocevar
Message:

Fix a buffer overflow in zzcat.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/src/zzcat.c

    r4286 r4288  
    269269    } while(0)
    270270
    271 #define ROUNDUP(size) (((size) + 0xfff) & ~0xfff)
     271#define ROUNDUP(size) (((size) + 0x1000) & ~0xfff)
    272272
    273273#define MERGE(address, cnt, off) \
     
    277277        { \
    278278            retlen = retoff + _cnt; \
    279             if (ROUNDUP(retlen) != ROUNDUP(retlen - _cnt)) \
     279            if (!retbuf || ROUNDUP(retlen) != ROUNDUP(retlen - _cnt)) \
    280280                retbuf = realloc(retbuf, ROUNDUP(retlen)); \
    281281        } \
Note: See TracChangeset for help on using the changeset viewer.