Commit dc32152d authored by Tatsuya Kinoshita's avatar Tatsuya Kinoshita

Prevent invalid form_update_line() call in formUpdateBuffer()

Bug-Debian: https://github.com/tats/w3m/issues/82
parent d3048fe2
......@@ -490,7 +490,8 @@ formUpdateBuffer(Anchor *a, Buffer *buf, FormItemList *form)
spos = a->start.pos;
epos = a->end.pos;
}
if (a->start.line != a->end.line || spos > epos || epos >= l->len || spos < 0 || epos < 0)
if (a->start.line != a->end.line || spos > epos || epos >= l->len ||
spos < 0 || epos < 0 || COLPOS(l, epos) < col)
break;
pos = form_update_line(l, &p, spos, epos, COLPOS(l, epos) - col,
rows > 1,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment