diff options
| author | Tatsuya Kinoshita <tats@debian.org> | 2016-12-24 04:02:41 +0000 | 
|---|---|---|
| committer | Tatsuya Kinoshita <tats@debian.org> | 2017-01-06 14:20:43 +0000 | 
| commit | a4dfcecb543b517d1214677dde152220a95bf83d (patch) | |
| tree | e016e4085b8440b6bd2f507efea9846da9527c14 | |
| parent | Prevent invalid form_update_line() call in formUpdateBuffer() (diff) | |
| download | w3m-a4dfcecb543b517d1214677dde152220a95bf83d.tar.gz w3m-a4dfcecb543b517d1214677dde152220a95bf83d.zip | |
Preserve one byte for end of string character in form_update_line()
Bug-Debian: https://github.com/tats/w3m/issues/68#issuecomment-266214643
Origin: https://anonscm.debian.org/cgit/collab-maint/w3m.git/commit/?id=eb4130a7cd2202de6aeb772b7e4f2a417dbff173
| -rw-r--r-- | form.c | 3 | 
1 files changed, 2 insertions, 1 deletions
| @@ -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)); | 
