projects
/
platform
/
upstream
/
efl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1fb3c33
)
elput: Check return of read function call
author
Chris Michael
<cpmichael@osg.samsung.com>
Thu, 30 Jun 2016 14:54:22 +0000
(10:54 -0400)
committer
Chris Michael
<cpmichael@osg.samsung.com>
Thu, 30 Jun 2016 14:54:22 +0000
(10:54 -0400)
If we fail to read any bytes from the fd, then we should be returning
a failure here.
Fixes Coverity CID1357143
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
src/lib/elput/elput_input.c
patch
|
blob
|
history
diff --git
a/src/lib/elput/elput_input.c
b/src/lib/elput/elput_input.c
index
1baf2f8
..
bff5503
100644
(file)
--- a/
src/lib/elput/elput_input.c
+++ b/
src/lib/elput/elput_input.c
@@
-40,8
+40,10
@@
_cb_open_restricted(const char *path, int flags, void *data)
avail = select(p[0] + 1, &rfds, &wfds, &exfds, t);
if (avail > 0)
{
- read(p[0], &fd, sizeof(int));
- ret = fd;
+ if (read(p[0], &fd, sizeof(int)) < 1)
+ ret = -1;
+ else
+ ret = fd;
break;
}
if (avail < 0) break;