valeriyvdovin / rpms / systemd

Forked from rpms/systemd 4 years ago
Clone

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

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