Blob Blame History Raw
From 2bbdcbc8284ebca6df059f17e967d0444f6e786d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Thu, 9 Oct 2014 22:51:35 -0400
Subject: [PATCH] sd-journal: change check to assert

As of 0f99f74a14 'sd-journal: verify that object start with the field
name' this condition should never happen.

(cherry picked from commit 853bd5cc72a0d4cbdd07cc3cabc65bef333a0c71)
---
 src/journal/journalctl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index e57a5474de..07a08aa188 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -779,8 +779,7 @@ static int list_boots(sd_journal *j) {
                 return r;
 
         SD_JOURNAL_FOREACH_UNIQUE(j, data, length) {
-                if (length < strlen("_BOOT_ID="))
-                        continue;
+                assert(startswith(data, "_BOOT_ID="));
 
                 if (!GREEDY_REALLOC(all_ids, allocated, count + 1))
                         return log_oom();