mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Verify that fd redirection is an int
darcs-hash:20070127135010-ac50b-d9c048edc5579c460ed2b181c366c67e9cfd7beb.gz
This commit is contained in:
parent
d480d892c9
commit
cab5c63402
1 changed files with 7 additions and 2 deletions
9
parser.c
9
parser.c
|
@ -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 ),
|
||||||
|
|
Loading…
Reference in a new issue