Fix two crash bugs in highlighter/parser for malformed lines (Thanks to Netocrat for the bug report)

darcs-hash:20060703104647-ac50b-9eb649322611a3e7fd95ef5f80acdc25ce09d11a.gz
This commit is contained in:
axel
2006-07-03 20:46:47 +10:00
parent d56ab1d365
commit 7bb070d817
4 changed files with 31 additions and 24 deletions

View File

@@ -884,7 +884,7 @@ void highlight_shell( wchar_t * buff,
wchar_t *token;
parse_util_token_extent( buff, pos, &tok_begin, &tok_end, 0, 0 );
if( tok_begin )
if( tok_begin && tok_end )
{
token = halloc_wcsndup( context, tok_begin, tok_end-tok_begin );