aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches/953_formupdateline.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/953_formupdateline.patch')
-rw-r--r--debian/patches/953_formupdateline.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/debian/patches/953_formupdateline.patch b/debian/patches/953_formupdateline.patch
new file mode 100644
index 0000000..77ede43
--- /dev/null
+++ b/debian/patches/953_formupdateline.patch
@@ -0,0 +1,26 @@
+Subject: Preserve one byte for end of string character in form_update_line()
+From: Tatsuya Kinoshita <tats@debian.org>
+Bug-Debian: https://github.com/tats/w3m/issues/68#issuecomment-266214643
+Origin: https://anonscm.debian.org/cgit/collab-maint/w3m.git/commit/?id=eb4130a7cd2202de6aeb772b7e4f2a417dbff173
+
+---
+ form.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/form.c b/form.c
+index 162439a..0605513 100644
+--- a/form.c
++++ b/form.c
+@@ -320,7 +320,8 @@ form_update_line(Line *line, char **str, int spos, int epos, int width,
+ pos += width - w;
+
+ len = line->len + pos + spos - epos;
+- buf = New_N(char, len);
++ buf = New_N(char, len + 1);
++ buf[len] = '\0';
+ prop = New_N(Lineprop, len);
+ bcopy((void *)line->lineBuf, (void *)buf, spos * sizeof(char));
+ bcopy((void *)line->propBuf, (void *)prop, spos * sizeof(Lineprop));
+--
+2.10.2
+