projects
/
mech_eap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7bf1275
)
Check fread return value
author
Jouni Malinen
<jouni.malinen@atheros.com>
Mon, 21 Dec 2009 21:17:53 +0000
(23:17 +0200)
committer
Jouni Malinen
<j@w1.fi>
Mon, 21 Dec 2009 21:17:53 +0000
(23:17 +0200)
src/utils/os_internal.c
patch
|
blob
|
history
diff --git
a/src/utils/os_internal.c
b/src/utils/os_internal.c
index
7b74bbf
..
5260e23
100644
(file)
--- a/
src/utils/os_internal.c
+++ b/
src/utils/os_internal.c
@@
-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;