mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-30 06:03:49 +08:00
Protect against double-free of the process argument list
darcs-hash:20060222175107-ac50b-87c36439e2ec2f8be652db1595dad9a09e20f36c.gz
This commit is contained in:
parent
68e0c94dbb
commit
1a48941f6b
10
parser.c
10
parser.c
|
@ -1352,7 +1352,8 @@ static void parse_job_main_loop( process_t *p,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
p->pipe_fd = wcstol( tok_last( tok ), 0, 10 );
|
p->pipe_fd = wcstol( tok_last( tok ), 0, 10 );
|
||||||
halloc_register( j, p->argv=list_to_char_arr( args ) );
|
if( !p->argv )
|
||||||
|
halloc_register( j, p->argv = list_to_char_arr( args ) );
|
||||||
p->next = halloc( j, sizeof( process_t ) );
|
p->next = halloc( j, sizeof( process_t ) );
|
||||||
if( p->next == 0 )
|
if( p->next == 0 )
|
||||||
{
|
{
|
||||||
|
@ -1376,7 +1377,8 @@ static void parse_job_main_loop( process_t *p,
|
||||||
|
|
||||||
case TOK_END:
|
case TOK_END:
|
||||||
{
|
{
|
||||||
halloc_register( j, p->argv=list_to_char_arr( args ) );
|
if( !p->argv )
|
||||||
|
halloc_register( j, p->argv = list_to_char_arr( args ) );
|
||||||
if( tok_has_next(tok))
|
if( tok_has_next(tok))
|
||||||
tok_next(tok);
|
tok_next(tok);
|
||||||
|
|
||||||
|
@ -2086,8 +2088,8 @@ static int parse_job( process_t *p,
|
||||||
{
|
{
|
||||||
if( p->type == INTERNAL_BUILTIN && parser_skip_arguments( (wchar_t *)al_get(args, 0) ) )
|
if( p->type == INTERNAL_BUILTIN && parser_skip_arguments( (wchar_t *)al_get(args, 0) ) )
|
||||||
{
|
{
|
||||||
halloc_register( j, p->argv = list_to_char_arr( args ) );
|
if( !p->argv )
|
||||||
// tok_next(tok);
|
halloc_register( j, p->argv = list_to_char_arr( args ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user