commit | 7b8666e683e56549091b86fd7b9c421fd0124dbc | [log] [tgz] |
---|---|---|
author | Elliott Hughes <enh@google.com> | Mon Apr 16 09:06:22 2012 -0700 |
committer | android code review <noreply-gerritcodereview@google.com> | Mon Apr 16 09:06:22 2012 -0700 |
tree | 5d6f3f3a937a047b9423015a9e1c2e122644d25f | |
parent | 6435d27f9d45d01fbd15bcc3dcd9617b86b825bb [diff] | |
parent | 41070dd15f2c5916dfc96da4c256dd04d7f9c837 [diff] |
Merge "bionic: Fix wrong prototype of system call getresuid/getresgid"
diff --git a/libc/unistd/getcwd.c b/libc/unistd/getcwd.c index 1cf80e9..1172445 100644 --- a/libc/unistd/getcwd.c +++ b/libc/unistd/getcwd.c
@@ -26,10 +26,15 @@ * SUCH DAMAGE. */ #include <unistd.h> +#include <errno.h> extern int __getcwd(char * buf, size_t size); char *getcwd(char *buf, size_t size) { + if (buf == NULL || size == 0) { + errno = EINVAL; + return NULL; + } return ( __getcwd(buf, size) < 0 ) ? NULL : buf; }