ports/www/w3m/patches/patch-etc_c

30 lines
692 B
Text

Fix OOB access due to multiple backspaces
https://github.com/tats/w3m/commit/edc602651c506aeeb60544b55534dd1722a340d3
Index: etc.c
--- etc.c.orig
+++ etc.c
@@ -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;
}
}
@@ -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