From cf9497375842de9b1ba41e06ecc4a3844db02445 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 31 Jan 2012 13:30:03 +0100 Subject: [PATCH] libblkid: check blkid_probe_set_magic() return in GPT code [coverity scan] Signed-off-by: Karel Zak --- libblkid/src/partitions/gpt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libblkid/src/partitions/gpt.c b/libblkid/src/partitions/gpt.c index 0e44f6e829..a4838d84be 100644 --- a/libblkid/src/partitions/gpt.c +++ b/libblkid/src/partitions/gpt.c @@ -315,9 +315,10 @@ static int probe_gpt_pt(blkid_probe pr, blkid_probe_use_wiper(pr, lba * blkid_probe_get_size(pr), 8); - blkid_probe_set_magic(pr, lba << 9, + if (blkid_probe_set_magic(pr, lba << 9, sizeof(GPT_HEADER_SIGNATURE_STR) - 1, - (unsigned char *) GPT_HEADER_SIGNATURE_STR); + (unsigned char *) GPT_HEADER_SIGNATURE_STR)) + goto err; if (blkid_partitions_need_typeonly(pr)) /* caller does not ask for details about partitions */ -- 2.47.3