Skip to content

Commit

Permalink
Merge pull request #273 from rkta/bsoob
Browse files Browse the repository at this point in the history
Fix OOB access due to multiple backspaces
  • Loading branch information
tats committed Jul 18, 2023
2 parents 93ad5ee + edc6026 commit 25fb402
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions etc.c
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

0 comments on commit 25fb402

Please sign in to comment.