summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 f59858277e..3f1afdaf1f 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -765,6 +765,10 @@ int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset
o = (Object*) t;
s = le64toh(o->object.size);
+ if (s == 0) {
+ log_debug("Attempt to move to uninitialized object: %" PRIu64, offset);
+ return -EBADMSG;
+ }
if (s < sizeof(ObjectHeader)) {
log_debug("Attempt to move to overly short object: %" PRIu64, offset);
return -EBADMSG;