Prevent overflow beyond the end of string in form_update_line()

Bug-Debian: https://github.com/tats/w3m/issues/78
This commit is contained in:
Tatsuya Kinoshita
2016-12-10 16:38:44 +09:00
parent 52e9fc6b44
commit e0efc127ff

2
form.c
View File

@@ -388,7 +388,7 @@ form_update_line(Line *line, char **str, int spos, int epos, int width,
prop[pos] = effect | PC_ASCII;
pos++;
}
if (newline) {
if (p < q && newline) {
if (!FoldTextarea) {
while (*p && *p != '\r' && *p != '\n')
p++;