diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-01-11 21:24:02 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-01-11 21:24:02 +0100 |
commit | 7f120cc6a2eeea1b695222ff6e8e83b4f14ace59 (patch) | |
tree | 7527f24b006f7523859988ee084cd1a7740b350f | |
parent | 5e41cfec83aa47af12e469bc62e336f8213ee066 (diff) |
journald: don't assume size_t and uint64_t are the same
-rw-r--r-- | src/journal/journal-file.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 419e15e46f..6ba3d8dca3 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -640,7 +640,8 @@ int journal_file_find_data_object_with_hash( if (o->object.flags & OBJECT_COMPRESSED) { #ifdef HAVE_XZ - uint64_t l, rsize; + uint64_t l; + size_t rsize; l = le64toh(o->object.size); if (l <= offsetof(Object, data.payload)) @@ -651,7 +652,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 (rsize == size && + if ((uint64_t) rsize == size && memcmp(f->compress_buffer, data, size) == 0) { if (ret) |