]> 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)
committerThomas Weißschuh <thomas@t-8ch.de>
Thu, 28 Sep 2023 06:33:53 +0000 (08:33 +0200)
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
libblkid/src/probe.c

index 6c17fb457c6153e7eec98a8f42b82cf70377ef02..49d202772d4308f94288fdf4c6e2077a2e8e5732 100644 (file)
@@ -1902,7 +1902,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;