* tests/getcwd.c: Additional checks for getcwd arguments decoding.
---
 tests/getcwd.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/getcwd.c b/tests/getcwd.c
index 704a315..e4a791f 100644
--- a/tests/getcwd.c
+++ b/tests/getcwd.c
@@ -13,6 +13,14 @@ main(void)
 {
        long res;
        char cur_dir[PATH_MAX + 1];
+       static const size_t bogus_size = (size_t) 0xbadc0deddeadfaceULL;
+
+       syscall(__NR_getcwd, NULL, bogus_size);
+       printf("getcwd(NULL, %zu) = -1 EFAULT (%m)\n", bogus_size);
+
+       syscall(__NR_getcwd, (char *)-1L, sizeof(cur_dir));
+       printf("getcwd(%p, %zu) = -1 EFAULT (%m)\n",
+               (char *)-1L, sizeof(cur_dir));
 
        res = syscall(__NR_getcwd, cur_dir, sizeof(cur_dir));
 
-- 
1.7.10.4


------------------------------------------------------------------------------
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to