mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-07 20:30:52 +02:00
asan fuzzing fixes; fix incomplete multibyte chars in history expansion; new nosort GLOBSORT value
This commit is contained in:
@@ -1121,7 +1121,7 @@ history_expand (const char *hstring, char **output)
|
||||
|
||||
c = tchar;
|
||||
memset (mb, 0, sizeof (mb));
|
||||
for (k = 0; k < MB_LEN_MAX; k++)
|
||||
for (k = 0; k < MB_LEN_MAX && i < l; k++)
|
||||
{
|
||||
mb[k] = (char)c;
|
||||
memset (&ps, 0, sizeof (mbstate_t));
|
||||
|
||||
@@ -307,6 +307,10 @@ void
|
||||
_rl_start_using_history (void)
|
||||
{
|
||||
using_history ();
|
||||
#if 1
|
||||
if (_rl_saved_line_for_history && _rl_saved_line_for_history->data)
|
||||
_rl_free_undo_list ((UNDO_LIST *)_rl_saved_line_for_history->data);
|
||||
#endif
|
||||
_rl_free_saved_history_line ();
|
||||
_rl_history_search_pos = -99; /* some random invalid history position */
|
||||
}
|
||||
|
||||
+3
-1
@@ -983,6 +983,9 @@ rl_insert (int count, int c)
|
||||
break;
|
||||
}
|
||||
|
||||
/* If we didn't insert n and there are pending bytes, we need to insert
|
||||
them if _rl_insert_char didn't do that on its own. */
|
||||
|
||||
if (n != (unsigned short)-2) /* -2 = sentinel value for having inserted N */
|
||||
{
|
||||
/* setting rl_pending_input inhibits setting rl_last_func so we do it
|
||||
@@ -992,7 +995,6 @@ rl_insert (int count, int c)
|
||||
rl_executing_keyseq[rl_key_sequence_length = 0] = '\0';
|
||||
r = rl_execute_next (n);
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user