aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-12-15 14:10:38 +0000
committerTatsuya Kinoshita <tats@debian.org>2016-12-15 15:44:44 +0000
commit6eea841d3a0f8dc539584dc67b15f585a8213775 (patch)
tree2093dd670adfd30b53b5234a6c869100b0c04b09 /file.c
parentRevert "Prevent overflow beyond the end of string in proc_mchar()" (diff)
downloadw3m-6eea841d3a0f8dc539584dc67b15f585a8213775.tar.gz
w3m-6eea841d3a0f8dc539584dc67b15f585a8213775.zip
Prevent overflow beyond the end of string in caller of get_mclen()
Bug-Debian: https://github.com/tats/w3m/issues/59 Bug-Debian: https://github.com/tats/w3m/issues/73 Bug-Debian: https://github.com/tats/w3m/issues/74 Bug-Debian: https://github.com/tats/w3m/issues/76 Bug-Debian: https://github.com/tats/w3m/issues/79 Bug-Debian: https://github.com/tats/w3m/issues/80 Bug-Debian: https://github.com/tats/w3m/issues/83 Bug-Debian: https://github.com/tats/w3m/issues/84
Diffstat (limited to '')
-rw-r--r--file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/file.c b/file.c
index c618ad7..91fcfad 100644
--- a/file.c
+++ b/file.c
@@ -3455,7 +3455,7 @@ process_img(struct parsed_tag *tag, int width)
if (use_image) {
if (n > nw) {
char *r;
- for (r = q, n = 0; r; r += get_mclen(r), n += get_mcwidth(r)) {
+ for (r = q, n = 0; *r; r += get_mclen(r), n += get_mcwidth(r)) {
if (n + get_mcwidth(r) > nw)
break;
}