mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-07 18:52:35 +02:00
fix crash with null arithmetic for expression; fix size_t issue with history search string allocation
This commit is contained in:
+13
-1
@@ -1093,6 +1093,8 @@ rl_redisplay (void)
|
||||
wc_width = (temp >= 0) ? temp : 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
wc_width = 1; /* make sure it's set for the META_CHAR check */
|
||||
#endif
|
||||
|
||||
if (in == rl_point)
|
||||
@@ -1102,12 +1104,22 @@ rl_redisplay (void)
|
||||
}
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
if (META_CHAR (c) && _rl_output_meta_chars == 0) /* XXX - clean up */
|
||||
if (META_CHAR (c) && wc_bytes == 1 && wc_width == 1)
|
||||
#else
|
||||
if (META_CHAR (c))
|
||||
#endif
|
||||
{
|
||||
#if 0
|
||||
/* TAG: readline-8.3 20230227 */
|
||||
/* https://savannah.gnu.org/support/index.php?110830
|
||||
asking for non-printing meta characters to be printed using an
|
||||
escape sequence. */
|
||||
|
||||
/* isprint(c) handles bytes up to UCHAR_MAX */
|
||||
if (_rl_output_meta_chars == 0 || isprint (c) == 0)
|
||||
#else
|
||||
if (_rl_output_meta_chars == 0)
|
||||
#endif
|
||||
{
|
||||
char obuf[5];
|
||||
int olen;
|
||||
|
||||
@@ -621,7 +621,7 @@ rl_history_search_reinit (int flags)
|
||||
if (rl_point)
|
||||
{
|
||||
/* Allocate enough space for anchored and non-anchored searches */
|
||||
if (_rl_history_search_len >= history_string_size - 2)
|
||||
if (_rl_history_search_len + 2 >= history_string_size)
|
||||
{
|
||||
history_string_size = _rl_history_search_len + 2;
|
||||
history_search_string = (char *)xrealloc (history_search_string, history_string_size);
|
||||
|
||||
Reference in New Issue
Block a user