From: Luca Boccassi Date: Thu, 20 May 2021 09:35:36 +0000 (+0100) Subject: journal: fix uninitialized variable use X-Git-Tag: v249-rc1~181^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=06a368e8198a9cbfad86ba17bba6a76a33f15492;p=thirdparty%2Fsystemd.git journal: fix uninitialized variable use If the journal file being processed is archivied, seqnum_id will not be initialized before being passed on, and coverity complains. Initialize it to zero. CID #1453235 --- diff --git a/src/libsystemd/sd-journal/journal-vacuum.c b/src/libsystemd/sd-journal/journal-vacuum.c index 7b57ba5ec3c..494a54d33b1 100644 --- a/src/libsystemd/sd-journal/journal-vacuum.c +++ b/src/libsystemd/sd-journal/journal-vacuum.c @@ -206,6 +206,9 @@ int journal_directory_vacuum( } else if (endswith(de->d_name, ".journal~")) { unsigned long long tmp; + /* seqnum_id won't be initialised before use below, so set to 0 */ + seqnum_id = SD_ID128_NULL; + /* Vacuum corrupted files */ if (q < 1 + 16 + 1 + 16 + 8 + 1) {