Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OOB access due to multiple backspaces #273

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions etc.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,10 @@ checkType(Str s, Lineprop **oprop, Linecolor **ocolor)
if (color)
color -= plen;
#endif
plen = *(--plens);
if (plens == plens_buffer)
plen = 0;
else
plen = *(--plens);
str += 2;
}
}
Expand All @@ -419,7 +422,10 @@ checkType(Str s, Lineprop **oprop, Linecolor **ocolor)
if (color)
color -= plen;
#endif
plen = *(--plens);
if (plens == plens_buffer)
plen = 0;
else
plen = *(--plens);
str++;
}
#else
Expand Down