* path.cc (symlink): Check arguments for validity.

(getcwd): Ditto.
* syscalls.cc (ftruncate): Ditto.
* times.cc (times): Ditto.
* uname.cc (uname): Ditto.
This commit is contained in:
Egor Duda
2001-09-16 14:26:11 +00:00
parent d595839939
commit 0aca521ab8
5 changed files with 39 additions and 13 deletions

View File

@@ -1768,7 +1768,11 @@ ftruncate (int fd, off_t length)
sigframe thisframe (mainthread);
int res = -1;
if (cygheap->fdtab.not_open (fd))
if (length < 0)
{
set_errno (EINVAL);
}
else if (cygheap->fdtab.not_open (fd))
{
set_errno (EBADF);
}