(which was also made larger).
int *f_in, int *f_out)
{
int i, argc = 0;
int *f_in, int *f_out)
{
int i, argc = 0;
pid_t ret;
char *tok, *dir = NULL;
int dash_l_set = 0;
pid_t ret;
char *tok, *dir = NULL;
int dash_l_set = 0;
- for (tok = strtok(cmd, " "); tok; tok = strtok(NULL, " "))
+ for (tok = strtok(cmd, " "); tok; tok = strtok(NULL, " ")) {
+ if (argc >= MAX_ARGS) {
+ rprintf(FERROR, "Command is too long\n");
+ exit_cleanup(RERR_SYNTAX);
+ }
/* check to see if we've already been given '-l user' in
* the remote-shell command */
/* check to see if we've already been given '-l user' in
* the remote-shell command */