[PATCH] libblkid: fix segfault in drdb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Check if blkid_probe_get_buffer() returns NULL to avoid dereferencing
a zero pointer resulting in a segfault.

Signed-off-by: Matthias König <mk@xxxxxxxxxxxx>
---
 0 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/shlibs/blkid/src/superblocks/drbd.c b/shlibs/blkid/src/superblocks/drbd.c
index e0bbb4d..a56486e 100644
--- a/shlibs/blkid/src/superblocks/drbd.c
+++ b/shlibs/blkid/src/superblocks/drbd.c
@@ -78,7 +78,8 @@ static int probe_drbd(blkid_probe pr, const struct blkid_idmag *mag)
 		blkid_probe_get_buffer(pr,
 		off,
 		sizeof(struct md_on_disk_08));
-
+	if (!md)
+		return -1;
 
 	if (be32_to_cpu(md->magic) != DRBD_MD_MAGIC_08)
 		return -1;

--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux