Skip to content

Commit

Permalink
More GCC *sigh*
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Apr 19, 2013
1 parent e1247b6 commit 4c3030d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/exec.c
Expand Up @@ -99,13 +99,15 @@ pid_t radius_start_program(const char *cmd, REQUEST *request,
#endif
int argc;
int i;
char *argv[MAX_ARGV];
const char *argv[MAX_ARGV];
char **argv_p;
char argv_buf[4096];
#define MAX_ENVP 1024
char *envp[MAX_ENVP];

memcpy(&argv_p, &argv, sizeof(argv_p));

argc = rad_expand_xlat(request, cmd, MAX_ARGV, (const char **) argv, 1,
sizeof(argv_buf), argv_buf);
argc = rad_expand_xlat(request, cmd, MAX_ARGV, argv, 1, sizeof(argv_buf), argv_buf);
if (argc <= 0) {
RDEBUG("invalid command line '%s'.", cmd);
return -1;
Expand Down Expand Up @@ -258,7 +260,7 @@ pid_t radius_start_program(const char *cmd, REQUEST *request,
*/
closefrom(3);

execve(argv[0], argv, envp);
execve(argv_p[0], argv_p, envp);
RDEBUGW("Failed to execute %s: %s", argv[0], strerror(errno));
exit(1);
}
Expand Down

0 comments on commit 4c3030d

Please sign in to comment.