Verify that fd redirection is an int

darcs-hash:20070127135010-ac50b-d9c048edc5579c460ed2b181c366c67e9cfd7beb.gz
This commit is contained in:
axel 2007-01-27 23:50:10 +10:00
parent d480d892c9
commit cab5c63402

View file

@ -1625,12 +1625,17 @@ static void parse_job_argument_list( process_t *p,
} }
else else
{ {
wchar_t *end;
new_io->io_mode = IO_FD; new_io->io_mode = IO_FD;
errno = 0;
new_io->param1.old_fd = wcstol( target, new_io->param1.old_fd = wcstol( target,
0, &end,
10 ); 10 );
if( ( new_io->param1.old_fd < 0 ) || if( ( new_io->param1.old_fd < 0 ) ||
( new_io->param1.old_fd > 10 ) ) errno || *end )
{ {
error( SYNTAX_ERROR, error( SYNTAX_ERROR,
tok_get_pos( tok ), tok_get_pos( tok ),