Skip to content

Commit

Permalink
Fix benign off by one error in library_syscall getdents64 implementat…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
juj committed Dec 7, 2016
1 parent 0efac40 commit d4c92a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/library_syscall.js
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ var SyscallsLibrary = {
stream.getdents = FS.readdir(stream.path);
}
var pos = 0;
while (stream.getdents.length > 0 && pos + {{{ C_STRUCTS.dirent.__size__ }}} < count) {
while (stream.getdents.length > 0 && pos + {{{ C_STRUCTS.dirent.__size__ }}} <= count) {
var id;
var type;
var name = stream.getdents.pop();
Expand Down

0 comments on commit d4c92a2

Please sign in to comment.