mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-21 03:14:19 +08:00
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:
parent
6edeb335f0
commit
84deac219d
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user