Blame SOURCES/0389-lz4-fix-size-check-which-had-no-chance-of-working-on.patch

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