1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-11 14:10:34 +00:00

g_read_data() can return NULL, check for it.

Found by:	Coverity (ID#258)
This commit is contained in:
Poul-Henning Kamp 2005-03-18 07:03:56 +00:00
parent b3fd9b46bb
commit cb7ff8b71d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=143792

View File

@ -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;