util-linux/backport-libblkid-bsd-fix-buffer-pointer-use-fuzzing.patch
z30031144 7256e99e59 Sync community patches
(cherry picked from commit 0c076c6b8e45ffb530b27a96d1e1810a97c5e9ee)
2022-11-08 14:33:06 +08:00

25 lines
871 B
Diff

From 0a0630133055c3b3daa3072a3fd9944a1a149401 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Thu, 2 Jun 2022 16:02:54 +0200
Subject: [PATCH] libblkid: (bsd) fix buffer pointer use [fuzzing]
Reported-by: Thibault Guittet <tguittet@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
libblkid/src/partitions/bsd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libblkid/src/partitions/bsd.c b/libblkid/src/partitions/bsd.c
index c74517334f..7a0b23195e 100644
--- a/libblkid/src/partitions/bsd.c
+++ b/libblkid/src/partitions/bsd.c
@@ -50,7 +50,7 @@ static int probe_bsd_pt(blkid_probe pr, const struct blkid_idmag *mag)
goto nothing;
}
- l = (struct bsd_disklabel *) data + BLKID_MAG_LASTOFFSET(mag);
+ l = (struct bsd_disklabel *) (data + BLKID_MAG_LASTOFFSET(mag));
ls = blkid_probe_get_partlist(pr);
if (!ls)