projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'firewire-update' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[linux-2.6-microblaze.git]
/
lib
/
decompress_unlz4.c
diff --git
a/lib/decompress_unlz4.c
b/lib/decompress_unlz4.c
index
c0cfcfd
..
e632739
100644
(file)
--- a/
lib/decompress_unlz4.c
+++ b/
lib/decompress_unlz4.c
@@
-112,6
+112,9
@@
STATIC inline int INIT unlz4(u8 *input, long in_len,
error("data corrupted");
goto exit_2;
}
error("data corrupted");
goto exit_2;
}
+ } else if (size < 4) {
+ /* empty or end-of-file */
+ goto exit_3;
}
chunksize = get_unaligned_le32(inp);
}
chunksize = get_unaligned_le32(inp);
@@
-125,6
+128,10
@@
STATIC inline int INIT unlz4(u8 *input, long in_len,
continue;
}
continue;
}
+ if (!fill && chunksize == 0) {
+ /* empty or end-of-file */
+ goto exit_3;
+ }
if (posp)
*posp += 4;
if (posp)
*posp += 4;
@@
-184,6
+191,7
@@
STATIC inline int INIT unlz4(u8 *input, long in_len,
}
}
}
}
+exit_3:
ret = 0;
exit_2:
if (!input)
ret = 0;
exit_2:
if (!input)