From cab5c63402101b1f5568f37a5b401db170a67dbf Mon Sep 17 00:00:00 2001 From: axel Date: Sat, 27 Jan 2007 23:50:10 +1000 Subject: [PATCH] Verify that fd redirection is an int darcs-hash:20070127135010-ac50b-d9c048edc5579c460ed2b181c366c67e9cfd7beb.gz --- parser.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/parser.c b/parser.c index 8a8525870..9ea7ce285 100644 --- a/parser.c +++ b/parser.c @@ -1625,12 +1625,17 @@ static void parse_job_argument_list( process_t *p, } else { + wchar_t *end; + new_io->io_mode = IO_FD; + errno = 0; + new_io->param1.old_fd = wcstol( target, - 0, + &end, 10 ); + if( ( new_io->param1.old_fd < 0 ) || - ( new_io->param1.old_fd > 10 ) ) + errno || *end ) { error( SYNTAX_ERROR, tok_get_pos( tok ),