mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
less: fix SEGV
testcase: echo "" | less, then press ')' key Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
560cf8c7eb
commit
252559601f
@ -1591,7 +1591,9 @@ static void match_right_bracket(char bracket)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
if (strchr(flines[cur_fline], bracket) == NULL) {
|
||||
if (cur_fline >= max_fline
|
||||
|| strchr(flines[cur_fline], bracket) == NULL
|
||||
) {
|
||||
print_statusline("No bracket in top line");
|
||||
return;
|
||||
}
|
||||
@ -1609,7 +1611,9 @@ static void match_left_bracket(char bracket)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (strchr(flines[cur_fline + max_displayed_line], bracket) == NULL) {
|
||||
if (cur_fline + max_displayed_line >= max_fline
|
||||
|| strchr(flines[cur_fline + max_displayed_line], bracket) == NULL
|
||||
) {
|
||||
print_statusline("No bracket in bottom line");
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user