diff options
author | Matthias König | 2010-01-12 13:58:28 +0100 |
---|---|---|
committer | Karel Zak | 2010-01-22 10:30:33 +0100 |
commit | 10f494e1a0ac09e144a42fcaeb72663674eb30fc (patch) | |
tree | 7dfd7643e0910ceaf98b20e6a3e95ccd7356bd67 /shlibs/blkid/src/superblocks/drbd.c | |
parent | libblkid: don't probe for GPT and Unixware PT on floppies (diff) | |
download | kernel-qcow2-util-linux-10f494e1a0ac09e144a42fcaeb72663674eb30fc.tar.gz kernel-qcow2-util-linux-10f494e1a0ac09e144a42fcaeb72663674eb30fc.tar.xz kernel-qcow2-util-linux-10f494e1a0ac09e144a42fcaeb72663674eb30fc.zip |
libblkid: fix segfault in drdb
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@phasorlab.de>
Diffstat (limited to 'shlibs/blkid/src/superblocks/drbd.c')
-rw-r--r-- | shlibs/blkid/src/superblocks/drbd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/shlibs/blkid/src/superblocks/drbd.c b/shlibs/blkid/src/superblocks/drbd.c index e0bbb4d66..a56486e97 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; |