From e0efc127ff20cbeb931847af1c9b353056340fbd Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Sat, 10 Dec 2016 16:38:44 +0900 Subject: Prevent overflow beyond the end of string in form_update_line() Bug-Debian: https://github.com/tats/w3m/issues/78 --- form.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'form.c') diff --git a/form.c b/form.c index 88b23b4..0dfbaa8 100644 --- a/form.c +++ b/form.c @@ -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++; -- cgit v1.2.3