]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-journal: make journal_file_copy_entry() return earlier 27419/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 26 Apr 2023 11:54:08 +0000 (20:54 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 26 Apr 2023 11:54:08 +0000 (20:54 +0900)
src/libsystemd/sd-journal/journal-file.c

index e9bb893ca824fb8a62adaee57048764a0dfafe12..f6a86fe599926098abf8a6d9eb98b66ad64596b8 100644 (file)
@@ -4188,6 +4188,8 @@ int journal_file_copy_entry(
         boot_id = o->entry.boot_id;
 
         n = journal_file_entry_n_items(from, o);
+        if (n == 0)
+                return 0;
 
         if (n < ALLOCA_MAX / sizeof(EntryItem) / 2)
                 items = newa(EntryItem, n);