From b785c858c3baf855ec42e3b83f5d23dadfece069 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 11 Jan 2012 22:44:43 +0100 Subject: [PATCH] journal: fix more 32/64 bit issues --- src/journal/journal-file.c | 5 ++--- src/journal/journal-file.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 6ba3d8dc..419e15e4 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -640,8 +640,7 @@ int journal_file_find_data_object_with_hash( if (o->object.flags & OBJECT_COMPRESSED) { #ifdef HAVE_XZ - uint64_t l; - size_t rsize; + uint64_t l, rsize; l = le64toh(o->object.size); if (l <= offsetof(Object, data.payload)) @@ -652,7 +651,7 @@ int journal_file_find_data_object_with_hash( if (!uncompress_blob(o->data.payload, l, &f->compress_buffer, &f->compress_buffer_size, &rsize)) return -EBADMSG; - if ((uint64_t) rsize == size && + if (rsize == size && memcmp(f->compress_buffer, data, size) == 0) { if (ret) diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h index 0be39329..4ef4a144 100644 --- a/src/journal/journal-file.h +++ b/src/journal/journal-file.h @@ -77,7 +77,7 @@ typedef struct JournalFile { #ifdef HAVE_XZ void *compress_buffer; - size_t compress_buffer_size; + uint64_t compress_buffer_size; #endif } JournalFile; -- 2.39.5