diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2016-12-10 08:32:49 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2016-12-10 09:18:58 +0000 |
commit | f763b8ebf5441cb44d2c0234565fadd5eb1c87a5 (patch) | |
tree | 4c32cbca1c4507c3d6a5468f3cc293ee32622e2d /table.c | |
parent | Prevent overflow beyond the end of string for wtf to wcs macros (diff) | |
download | w3m-f763b8ebf5441cb44d2c0234565fadd5eb1c87a5.tar.gz w3m-f763b8ebf5441cb44d2c0234565fadd5eb1c87a5.zip |
Prevent overflow beyond the end of string in visible_length_plain()
Bug-Debian: https://github.com/tats/w3m/issues/76
Diffstat (limited to '')
-rw-r--r-- | table.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -510,8 +510,9 @@ int visible_length_plain(char *str) { int len = 0, max_len = 0; + char *strz = str + strlen(str); - while (*str) { + while (str < strz) { if (*str == '\t') { do { len++; |