Displaying 1 result from an estimated 1 matches for "header_size_min".
2011 Nov 11
0
[PATCH 9/9] Decompressors: check input size in unlzo.c
...lin <lasse.collin@tukaani.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/common/unlzo.c
+++ b/xen/common/unlzo.c
@@ -63,14 +63,25 @@ static const unsigned char lzop_magic[]
#define LZO_BLOCK_SIZE (256*1024l)
#define HEADER_HAS_FILTER 0x00000800L
+#define HEADER_SIZE_MIN (9 + 7 + 4 + 8 + 1 + 4)
+#define HEADER_SIZE_MAX (9 + 7 + 1 + 8 + 8 + 4 + 1 + 255 + 4)
-static int INIT parse_header(u8 *input, u8 *skip)
+static int INIT parse_header(u8 *input, int *skip, int in_len)
{
int l;
u8 *parse = input;
+ u8 *end = input + in_len;
u8 lev...