aboutsummaryrefslogtreecommitdiffstats
path: root/form.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-12-10 07:38:44 +0000
committerTatsuya Kinoshita <tats@debian.org>2016-12-10 07:38:44 +0000
commite0efc127ff20cbeb931847af1c9b353056340fbd (patch)
tree2abc8b1838732ee790101b162d1ff52fb3bd8924 /form.c
parentUpdate ChangeLog (diff)
downloadw3m-e0efc127ff20cbeb931847af1c9b353056340fbd.tar.gz
w3m-e0efc127ff20cbeb931847af1c9b353056340fbd.zip
Prevent overflow beyond the end of string in form_update_line()
Bug-Debian: https://github.com/tats/w3m/issues/78
Diffstat (limited to '')
-rw-r--r--form.c2
1 files changed, 1 insertions, 1 deletions
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++;