]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-journal: check retval of sd_id128_from_string call 23733/head
authorShreenidhi Shedi <sshedi@vmware.com>
Tue, 14 Jun 2022 04:58:37 +0000 (10:28 +0530)
committerShreenidhi Shedi <sshedi@vmware.com>
Tue, 14 Jun 2022 12:22:48 +0000 (17:52 +0530)
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.

src/libsystemd/sd-journal/sd-journal.c

index 5138993f0561ab59759c5607a889367f02ac1381..4a9f1a90b2f3edaed07601d1ab3d47b1ddf38eea 100644 (file)
@@ -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':