summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/lzma.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/lzma.c b/src/lib/lzma.c
index f72755392c..dbc464cc80 100644
--- a/src/lib/lzma.c
+++ b/src/lib/lzma.c
@@ -37,6 +37,8 @@ size_t ulzman(const void *src, size_t srcn, void *dst, size_t dstn)
* byte and re-construct. */
cp = src + LZMA_PROPERTIES_SIZE;
outSize = cp[3] << 24 | cp[2] << 16 | cp[1] << 8 | cp[0];
+ if (outSize > dstn)
+ outSize = dstn;
if (LzmaDecodeProperties(&state.Properties, properties,
LZMA_PROPERTIES_SIZE) != LZMA_RESULT_OK) {
printk(BIOS_WARNING, "lzma: Incorrect stream properties.\n");