Repositories
/
ecl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e714e3
)
Ensured that ecl_file_len() doesn't return a random value on error.
author
Arto Bendiken
<arto@bendiken.net>
Tue, 14 Oct 2014 22:02:12 +0000
(22:02 +0000)
committer
Arto Bendiken
<arto@bendiken.net>
Tue, 14 Oct 2014 22:04:30 +0000
(22:04 +0000)
This partially addresses CID 66411 (Unchecked return value from library).
The call to fstat() should still probably have error checking added.
src/c/unixfsys.d
patch
|
blob
|
blame
|
history
diff --git
a/src/c/unixfsys.d
b/src/c/unixfsys.d
index
b64a4b1
..
f9f6d5c
100644
(file)
--- a/
src/c/unixfsys.d
+++ b/
src/c/unixfsys.d
@@
-454,6
+454,7
@@
cl_object
ecl_file_len(int f)
{
struct stat filestatus;
+ memset(&filestatus, 0, sizeof(filestatus));
ecl_disable_interrupts();
fstat(f, &filestatus);
ecl_enable_interrupts();