]> mj.ucw.cz Git - libucw.git/commitdiff
hmm, if we use fast unaligned access when decompressing, we should allocate 3
authorRobert Spalek <robert@ucw.cz>
Wed, 23 Jun 2004 17:09:37 +0000 (17:09 +0000)
committerRobert Spalek <robert@ucw.cz>
Wed, 23 Jun 2004 17:09:37 +0000 (17:09 +0000)
more bytes after the memory

lib/lizard-safe.c

index c615acc4b131a704ee046cba9b3575dfa11dd13b..6bba2544915ba142371e7400ad43a55d85263e27 100644 (file)
@@ -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;