projects
/
platform
/
upstream
/
libwebsockets.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
956a08a
)
coverity 83659 plat unix check fstat return
author
Andy Green
<andy.green@linaro.org>
Sun, 30 Nov 2014 05:03:45 +0000
(13:03 +0800)
committer
Andy Green
<andy.green@linaro.org>
Sun, 30 Nov 2014 05:10:26 +0000
(13:10 +0800)
Signed-off-by: Andy Green <andy.green@linaro.org>
lib/lws-plat-unix.c
patch
|
blob
|
history
diff --git
a/lib/lws-plat-unix.c
b/lib/lws-plat-unix.c
index
cc1c125
..
e81bb1e
100644
(file)
--- a/
lib/lws-plat-unix.c
+++ b/
lib/lws-plat-unix.c
@@
-423,7
+423,10
@@
lws_plat_open_file(const char* filename, unsigned long* filelen)
if (ret < 0)
return LWS_INVALID_FILE;
- fstat(ret, &stat_buf);
+ if (fstat(ret, &stat_buf) < 0) {
+ close(ret);
+ return LWS_INVALID_FILE;
+ }
*filelen = stat_buf.st_size;
return ret;
}