summaryrefslogtreecommitdiff
path: root/payloads/libpayload/liblzma
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload/liblzma')
-rw-r--r--payloads/libpayload/liblzma/lzma.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/payloads/libpayload/liblzma/lzma.c b/payloads/libpayload/liblzma/lzma.c
index 57a8b3a5c7..1845afc883 100644
--- a/payloads/libpayload/liblzma/lzma.c
+++ b/payloads/libpayload/liblzma/lzma.c
@@ -28,6 +28,11 @@ unsigned long ulzman(const unsigned char *src, unsigned long srcn,
SizeT mallocneeds;
unsigned char *scratchpad;
+ if (srcn < data_offset) {
+ printf("lzma: Input too small.\n");
+ return 0;
+ }
+
memcpy(properties, src, LZMA_PROPERTIES_SIZE);
memcpy(&outSize, src + LZMA_PROPERTIES_SIZE, sizeof(outSize));
if (outSize > dstn)