summaryrefslogtreecommitdiff
path: root/src/commonlib/bsd/lz4_wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/commonlib/bsd/lz4_wrapper.c')
-rw-r--r--src/commonlib/bsd/lz4_wrapper.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/commonlib/bsd/lz4_wrapper.c b/src/commonlib/bsd/lz4_wrapper.c
index 2367afceaf..3822e8c60f 100644
--- a/src/commonlib/bsd/lz4_wrapper.c
+++ b/src/commonlib/bsd/lz4_wrapper.c
@@ -129,6 +129,9 @@ size_t ulz4fn(const void *src, size_t srcn, void *dst, size_t dstn)
}
while (1) {
+ if ((size_t)(in - src) + sizeof(struct lz4_block_header) > srcn)
+ break; /* input overrun */
+
struct lz4_block_header b = {
{ .raw = le32toh(*(const uint32_t *)in) }
};