mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-05 03:07:56 +00:00
the execve system call if the envp pointer is null as it causes valgrind to die with a segmentation fault. CCMAIL: 83573-done@bugs.kde.org git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2427
20 lines
305 B
C
20 lines
305 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
if (argc == 1)
|
|
{
|
|
char *newargv[3] = { argv[0], "done", NULL };
|
|
|
|
if (execve(argv[0], newargv, NULL) < 0)
|
|
{
|
|
perror("execve");
|
|
exit(1);
|
|
}
|
|
}
|
|
|
|
exit(0);
|
|
}
|