diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2001-10-19 23:17:04 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2001-10-19 23:17:04 +0400 |
commit | 5318c4983306850bffa748b4feaa87f7c6d666bb (patch) | |
tree | 9e50a78204bacd405fa5b05488cea3c8c34db870 /winsup | |
parent | da8f3291d1d4f5bd77e057cd75ae1c7e2de0ffb5 (diff) |
* path.cc (getcwd): Allow len == 0 when buf == NULL.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 4 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 5a8ed18f4..ccb4a8212 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2001-10-19 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (getcwd): Allow len == 0 when buf == NULL. + 2001-10-18 Christopher Faylor <cgf@redhat.com> * syscalls.cc (_read): Validate input pointer. diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 317b3a6d7..066ef2e30 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -3120,7 +3120,7 @@ char * getcwd (char *buf, size_t ulen) { char* res = NULL; - if (ulen == 0) + if (ulen == 0 && buf) set_errno (EINVAL); else if (buf == NULL || !__check_null_invalid_struct_errno (buf, ulen)) res = cygheap->cwd.get (buf, 1, 1, ulen); |