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