projects
/
rtos
/
tinyara.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
05226e9
)
Fix SVACE defect in IoT.js (fs.scandir)
author
Sanggyu Lee
<sg5.lee@samsung.com>
Fri, 29 Sep 2017 06:06:36 +0000
(15:06 +0900)
committer
Sanggyu Lee
<sg5.lee@samsung.com>
Fri, 29 Sep 2017 06:07:22 +0000
(15:07 +0900)
external/iotjs/deps/libtuv/src/unix/fs.c
patch
|
blob
|
history
diff --git
a/external/iotjs/deps/libtuv/src/unix/fs.c
b/external/iotjs/deps/libtuv/src/unix/fs.c
index
a364375
..
df59d29
100644
(file)
--- a/
external/iotjs/deps/libtuv/src/unix/fs.c
+++ b/
external/iotjs/deps/libtuv/src/unix/fs.c
@@
-407,6
+407,12
@@
static ssize_t uv__fs_scandir(uv_fs_t* req) {
cnt++;
}
+ if (cnt > 0 && dents == NULL) {
+ closedir(dir);
+ cnt = -1;
+ goto error;
+ }
+
/* Allcoate memory for the directory entries. */
dents = (uv__dirent_t**) malloc(sizeof (uv__dirent_t*) * cnt);