summaryrefslogtreecommitdiff
path: root/src/journal/journal-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal/journal-file.c')
-rw-r--r--src/journal/journal-file.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index ac6c30f9f2..c4318636f7 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -709,6 +709,10 @@ int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset
if (!VALID64(offset))
return -EFAULT;
+ /* Object may not be located in the file header */
+ if (offset < le64toh(f->header->header_size))
+ return -EBADMSG;
+
r = journal_file_move_to(f, type, false, offset, sizeof(ObjectHeader), &t);
if (r < 0)
return r;