mirror of
https://github.com/FAUSheppy/colorredstderr-mirror
synced 2025-12-05 22:51:38 +01:00
Prevent crash in execve() if env is NULL
This commit is contained in:
@@ -554,6 +554,11 @@ pid_t vfork(void) {
|
||||
HOOK_FUNC_DEF3(int, execve, char const *, filename, char * const *, argv, char * const *, env) {
|
||||
DLSYM_FUNCTION(real_execve, "execve");
|
||||
|
||||
char * const fake_env[] = {NULL};
|
||||
if (env == NULL) {
|
||||
env = fake_env;
|
||||
}
|
||||
|
||||
/* Count environment variables. */
|
||||
size_t count = 0;
|
||||
char * const *x = env;
|
||||
|
||||
Reference in New Issue
Block a user