diff options
author | phk <phk@FreeBSD.org> | 2005-03-18 07:03:56 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-03-18 07:03:56 +0000 |
commit | 31aaa9f6198024c1cc3577fa790611aee75ee00f (patch) | |
tree | 336558287ae58600ecfb3c608bd8e78965c1dd4d /sys/geom | |
parent | 05ad1057532ca09b1dcee1676dcf79dfb12fe679 (diff) | |
download | FreeBSD-src-31aaa9f6198024c1cc3577fa790611aee75ee00f.zip FreeBSD-src-31aaa9f6198024c1cc3577fa790611aee75ee00f.tar.gz |
g_read_data() can return NULL, check for it.
Found by: Coverity (ID#258)
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/geom_gpt.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/geom/geom_gpt.c b/sys/geom/geom_gpt.c index 72120f4..77317b1 100644 --- a/sys/geom/geom_gpt.c +++ b/sys/geom/geom_gpt.c @@ -188,6 +188,8 @@ g_gpt_taste(struct g_class *mp, struct g_provider *pp, int insist __unused) tblsz = (entries * entsz + secsz - 1) & ~(secsz - 1); buf = g_read_data(cp, le64toh(hdr->hdr_lba_table) * secsz, tblsz, &error); + if (buf == NULL) + break; for (i = 0; i < entries; i++) { struct uuid unused = GPT_ENT_TYPE_UNUSED; |