mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-18 02:44:03 -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;
|
||||
}
|
||||
|
||||
fread(buf, 1, *len, f);
|
||||
if (fread(buf, 1, *len, f) != *len) {
|
||||
fclose(f);
|
||||
os_free(buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
|
||||
return buf;
|
||||
|
Loading…
Reference in New Issue
Block a user