Check value returned by g_read_data(9), otherwise we can end in panic(9)

if read error happens.

MFC after:	1 week
This commit is contained in:
Maxim Sobolev 2005-11-29 03:03:34 +00:00
parent 2207c7648e
commit 5c8a6f63b2

View File

@ -74,6 +74,9 @@ g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size)
goto done;
filerecp = g_read_data(cp, voloff, recsize, &error);
if (filerecp == NULL)
goto done;
fr = (struct filerec *)filerecp;
if(fr->fr_fixup.fh_magic != NTFS_FILEMAGIC){