Merge pull request #273 from rkta/bsoob
Fix OOB access due to multiple backspaces
This commit is contained in:
6
etc.c
6
etc.c
@@ -393,6 +393,9 @@ checkType(Str s, Lineprop **oprop, Linecolor **ocolor)
|
||||
if (color)
|
||||
color -= plen;
|
||||
#endif
|
||||
if (plens == plens_buffer)
|
||||
plen = 0;
|
||||
else
|
||||
plen = *(--plens);
|
||||
str += 2;
|
||||
}
|
||||
@@ -419,6 +422,9 @@ checkType(Str s, Lineprop **oprop, Linecolor **ocolor)
|
||||
if (color)
|
||||
color -= plen;
|
||||
#endif
|
||||
if (plens == plens_buffer)
|
||||
plen = 0;
|
||||
else
|
||||
plen = *(--plens);
|
||||
str++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user