mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-30 16:54:04 -05:00
Check fread return value
This commit is contained in:
parent
7bf127572c
commit
a698d28415
@ -206,7 +206,12 @@ char * os_readfile(const char *name, size_t *len)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
fread(buf, 1, *len, f);
|
if (fread(buf, 1, *len, f) != *len) {
|
||||||
|
fclose(f);
|
||||||
|
os_free(buf);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
|
Loading…
Reference in New Issue
Block a user