diff options
author | John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> | 2017-03-22 03:36:50 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-03-21 22:36:50 -0400 |
commit | f652c62d71a412704efe7c73c2066d1baaf83456 (patch) | |
tree | 585553d6172ead334067c7d59faab329ace1c394 /src | |
parent | 2c7ef56459bf6fe7761595585aa4eed5cd183f27 (diff) |
basic/journal-importer: Fix unaligned access in get_data_size() (#5622)
Diffstat (limited to 'src')
-rw-r--r-- | src/basic/journal-importer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/basic/journal-importer.c b/src/basic/journal-importer.c index d25fd358e8..66119d2de1 100644 --- a/src/basic/journal-importer.c +++ b/src/basic/journal-importer.c @@ -24,6 +24,7 @@ #include "fd-util.h" #include "parse-util.h" #include "string-util.h" +#include "unaligned.h" enum { IMPORTER_STATE_LINE = 0, /* waiting to read, or reading line */ @@ -203,7 +204,7 @@ static int get_data_size(JournalImporter *imp) { if (r <= 0) return r; - imp->data_size = le64toh( *(uint64_t *) data ); + imp->data_size = unaligned_read_le64(data); if (imp->data_size > DATA_SIZE_MAX) { log_error("Stream declares field with size %zu > DATA_SIZE_MAX = %u", imp->data_size, DATA_SIZE_MAX); |