From: Shreenidhi Shedi Date: Tue, 14 Jun 2022 04:58:37 +0000 (+0530) Subject: sd-journal: check retval of sd_id128_from_string call X-Git-Tag: v252-rc1~807^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F23733%2Fhead;p=thirdparty%2Fsystemd.git sd-journal: check retval of sd_id128_from_string call Fixes: CID#1469712 CID 1469712 (#1 of 1): Unused value (UNUSED_VALUE) returned_value: Assigning value from sd_id128_from_string(word + 2, &boot_id) to r here, but that stored value is overwritten before it can be used. --- diff --git a/src/libsystemd/sd-journal/sd-journal.c b/src/libsystemd/sd-journal/sd-journal.c index 5138993f056..4a9f1a90b2f 100644 --- a/src/libsystemd/sd-journal/sd-journal.c +++ b/src/libsystemd/sd-journal/sd-journal.c @@ -987,6 +987,8 @@ _public_ int sd_journal_seek_cursor(sd_journal *j, const char *cursor) { case 'b': boot_id_set = true; r = sd_id128_from_string(word + 2, &boot_id); + if (r < 0) + return r; break; case 'm':