mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00:00
Registered wrong string with halloc in expand_one, causing potential crash.
darcs-hash:20060210003539-ac50b-523cbc848435b7f2b4239cc83da897cc65c00c1c.gz
This commit is contained in:
parent
28f65c07b0
commit
4b2cc49aaa
1 changed files with 3 additions and 2 deletions
5
expand.c
5
expand.c
|
@ -41,6 +41,7 @@ parameter expansion.
|
|||
#include "complete.h"
|
||||
#include "translate.h"
|
||||
#include "parse_util.h"
|
||||
#include "halloc_util.h"
|
||||
|
||||
/**
|
||||
Description for child process
|
||||
|
@ -1607,7 +1608,7 @@ int expand_string( void *context,
|
|||
{
|
||||
for( i=start_count; i<al_get_count( end_out ); i++ )
|
||||
{
|
||||
halloc_register( context, al_get( end_out, i ) );
|
||||
halloc_register( context, (void *)al_get( end_out, i ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1650,7 +1651,7 @@ wchar_t *expand_one( void *context, wchar_t *string, int flags )
|
|||
al_foreach( &l, (void(*)(const void *))&free );
|
||||
al_destroy( &l );
|
||||
|
||||
halloc_register( context, string );
|
||||
halloc_register( context, one );
|
||||
return one;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue