rdoff.c: one more unsafe use of fread()

Use the same error pattern as the rest of the calls in this function.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
H. Peter Anvin 2017-04-17 14:25:13 -07:00
parent 6edeb335f0
commit 84deac219d

View File

@ -275,7 +275,11 @@ int rdfopenhere(rdffile * f, FILE * fp, int *refcount, const char *name)
f->fp = fp;
initpos = ftell(fp);
fread(buf, 6, 1, f->fp); /* read header */
/* read header */
if (fread(buf, 1, 6, f->fp) != 6) {
fclose(f->fp);
return rdf_errno = RDF_ERR_READ;
}
buf[6] = 0;
if (strcmp(buf, RDOFFId)) {