From: Robert Spalek Date: Wed, 23 Jun 2004 17:09:37 +0000 (+0000) Subject: hmm, if we use fast unaligned access when decompressing, we should allocate 3 X-Git-Tag: holmes-import~1040 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=f5cf4714afb910e52ab50fc2d0bb218813d51f71;p=libucw.git hmm, if we use fast unaligned access when decompressing, we should allocate 3 more bytes after the memory --- diff --git a/lib/lizard-safe.c b/lib/lizard-safe.c index c615acc4..6bba2544 100644 --- a/lib/lizard-safe.c +++ b/lib/lizard-safe.c @@ -53,7 +53,7 @@ lizard_decompress_safe(byte *in, struct lizard_buffer *buf, uns expected_length) * is caught in the case of buffer-overflow. The function is not re-entrant * because of a static longjmp handler. */ { - uns lock_offset = ALIGN(expected_length, PAGE_SIZE); + uns lock_offset = ALIGN(expected_length + 3, PAGE_SIZE); // +3 due to the unaligned access if (lock_offset > buf->len) { errno = EFBIG;