Fix buffer overflow for writes to memory buffer stream (bug 18549)
[glibc.git] / posix / tst-execvp1.c
blobecc673d12421030f73a2a280383eac9344fb2909
1 #include <errno.h>
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <unistd.h>
6 static int
7 do_test (void)
9 char *cwd = get_current_dir_name ();
10 if (cwd == NULL)
12 puts ("get_current_dir_name failed");
13 return 1;
16 /* Make sure we do not find a binary with the name we are going to
17 use. */
18 setenv ("PATH", cwd, 1);
20 char *argv[] = { (char *) "does-not-exist", NULL };
21 errno = 0;
22 execvp (argv[0], argv);
24 if (errno != ENOENT)
26 printf ("errno = %d (%m), expected ENOENT\n", errno);
27 return 1;
30 return 0;
33 #define TEST_FUNCTION do_test ()
34 #include "../test-skeleton.c"