Skip to content

Commit

Permalink
Fixed bug 2970 - Dereference argv without NULL check in MusicCMD_Star…
Browse files Browse the repository at this point in the history
…t function

Nitz

In function MusicCMD_Start:

perror(argv[0]);

Here argv getting d reference without NULL check.
  • Loading branch information
slouken committed Oct 13, 2017
1 parent 1320a49 commit 4815237
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions music_cmd.c
Expand Up @@ -158,21 +158,21 @@ void MusicCMD_Start(MusicCMD *music)

/* Unblock signals in case we're called from a thread */
{
sigset_t mask;
sigemptyset(&mask);
sigprocmask(SIG_SETMASK, &mask, NULL);
sigset_t mask;
sigemptyset(&mask);
sigprocmask(SIG_SETMASK, &mask, NULL);
}

/* Execute the command */
command = SDL_strdup(music->cmd);
argv = parse_args(command, music->file);
if ( argv != NULL ) {
execvp(argv[0], argv);
execvp(argv[0], argv);

/* exec() failed */
perror(argv[0]);
}
SDL_free(command);

/* exec() failed */
perror(argv[0]);
_exit(-1);
}
break;
Expand Down

0 comments on commit 4815237

Please sign in to comment.