Skip to content

Commit

Permalink
Fix SVACE defect in IoT.js (fs.scandir)
Browse files Browse the repository at this point in the history
[Philippe Coval]

While updating IoT.js in Tizen:RT,
I noticed this downstream patch,
it still applies to current version of IoT.js
so I am forwarding it upstream in libtuv.

To help tracking I am adding references to this changes.

Author: Sanggyu Lee <sg5.lee@samsung.com>
Bug-TizenRT: Samsung/TizenRT#2018
Cc: @juitem
Cc: @glistening
Change-Id: I16cbca383d4e5a7a8cc36eace93999a622f19adc
Forwarded: Samsung#122
Origin: Samsung/TizenRT#744
libtuv-DCO-1.0-Signed-off-by: Philippe Coval philippe.coval@osg.samsung.com
  • Loading branch information
rzr committed Aug 9, 2018
1 parent 9f32c3d commit d31217b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/unix/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit d31217b

Please sign in to comment.