mirror of
https://github.com/systemd/systemd.git
synced 2024-11-06 16:59:03 +03:00
journald: don't assume size_t and uint64_t are the same
This commit is contained in:
parent
5e41cfec83
commit
7f120cc6a2
@ -640,7 +640,8 @@ int journal_file_find_data_object_with_hash(
|
|||||||
|
|
||||||
if (o->object.flags & OBJECT_COMPRESSED) {
|
if (o->object.flags & OBJECT_COMPRESSED) {
|
||||||
#ifdef HAVE_XZ
|
#ifdef HAVE_XZ
|
||||||
uint64_t l, rsize;
|
uint64_t l;
|
||||||
|
size_t rsize;
|
||||||
|
|
||||||
l = le64toh(o->object.size);
|
l = le64toh(o->object.size);
|
||||||
if (l <= offsetof(Object, data.payload))
|
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))
|
if (!uncompress_blob(o->data.payload, l, &f->compress_buffer, &f->compress_buffer_size, &rsize))
|
||||||
return -EBADMSG;
|
return -EBADMSG;
|
||||||
|
|
||||||
if (rsize == size &&
|
if ((uint64_t) rsize == size &&
|
||||||
memcmp(f->compress_buffer, data, size) == 0) {
|
memcmp(f->compress_buffer, data, size) == 0) {
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
|
Loading…
Reference in New Issue
Block a user