923a60
From 942cfd50b5c03f19cfe1b03040c54b7a460b5593 Mon Sep 17 00:00:00 2001
923a60
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
923a60
Date: Tue, 1 Dec 2015 22:53:23 -0500
923a60
Subject: [PATCH] lz4: fix size check which had no chance of working on
923a60
 big-endian
923a60
923a60
Cherry-picked from: b3aa622929f81b44974d182636b1fde8b2a506e5
923a60
Related: #1318994
923a60
---
923a60
 src/journal/compress.c | 2 +-
923a60
 1 file changed, 1 insertion(+), 1 deletion(-)
923a60
923a60
diff --git a/src/journal/compress.c b/src/journal/compress.c
923a60
index c9a3399cca..4fb09f5965 100644
923a60
--- a/src/journal/compress.c
923a60
+++ b/src/journal/compress.c
923a60
@@ -190,7 +190,7 @@ int decompress_blob_lz4(const void *src, uint64_t src_size,
923a60
                 return -EBADMSG;
923a60
 
923a60
         size = le64toh( *(le64_t*)src );
923a60
-        if (size < 0 || (le64_t) size != *(le64_t*)src)
923a60
+        if (size < 0 || (unsigned) size != le64toh(*(le64_t*)src))
923a60
                 return -EFBIG;
923a60
         if ((size_t) size > *dst_alloc_size) {
923a60
                 out = realloc(*dst, size);