]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[freeswitch] Argument with 'nonnull' attribute passed null in reincarnate_protect()
authorAndrey Volk <andywolk@gmail.com>
Mon, 5 Apr 2021 22:19:57 +0000 (01:19 +0300)
committerAndrey Volk <andywolk@gmail.com>
Tue, 19 Oct 2021 17:39:37 +0000 (20:39 +0300)
src/switch.c

index abb66ef86faec582c36f6140d2f0ac052342e30c..d10994c4c25b0769ff593b7cc2599462cdc4aa94 100644 (file)
@@ -390,13 +390,13 @@ static void reincarnate_protect(char **argv) {
                        sigaction(SIGTERM, &sa15_prev, NULL);
                        sigaction(SIGCHLD, &sa17_prev, NULL);
                        if (argv) {
-                               if (execv(argv[0], argv) == -1) {
+                               if (argv[0] && execv(argv[0], argv) == -1) {
                                        char buf[256];
                                        fprintf(stderr, "Reincarnate execv() failed: %d %s\n", errno,
                                                        switch_strerror_r(errno, buf, sizeof(buf)));
                                }
                                fprintf(stderr, "Trying reincarnate-reexec plan B...\n");
-                               if (execvp(argv[0], argv) == -1) {
+                               if (argv[0] && execvp(argv[0], argv) == -1) {
                                        char buf[256];
                                        fprintf(stderr, "Reincarnate execvp() failed: %d %s\n", errno,
                                                        switch_strerror_r(errno, buf, sizeof(buf)));