]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: (probe) handle probe without chain gracefully
authorThomas Weißschuh <thomas@t-8ch.de>
Wed, 27 Sep 2023 22:51:42 +0000 (00:51 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 24 Nov 2023 09:55:32 +0000 (10:55 +0100)
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
libblkid/src/probe.c

index b4299493fb344e2f6f659f0e671a51bfca793267..fbf504a4699e32489424ec42bcc39b5c889ab1a6 100644 (file)
@@ -1838,7 +1838,7 @@ int blkid_probe_verify_csum_buf(blkid_probe pr, size_t n, const void *csum,
                /*
                 * Accept bad checksum if BLKID_SUBLKS_BADCSUM flags is set
                 */
-               if (chn->driver->id == BLKID_CHAIN_SUBLKS
+               if (chn && chn->driver->id == BLKID_CHAIN_SUBLKS
                    && (chn->flags & BLKID_SUBLKS_BADCSUM)) {
                        blkid_probe_set_value(pr, "SBBADCSUM", (unsigned char *) "1", 2);
                        goto accept;