aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-12-08 14:51:09 +0000
committerTatsuya Kinoshita <tats@debian.org>2016-12-08 14:51:09 +0000
commite757b43bcf8c439c167f62b6d3317ee9518cabbf (patch)
tree5f69b3826e34c8fbc8b6d25ab316bc5883b824c0
parentPrevent overflow beyond the end of string in visible_length() (diff)
downloadw3m-e757b43bcf8c439c167f62b6d3317ee9518cabbf.tar.gz
w3m-e757b43bcf8c439c167f62b6d3317ee9518cabbf.zip
Prevent overflow beyond the end of string in skip_space()
Bug-Debian: https://github.com/tats/w3m/issues/74
Diffstat (limited to '')
-rw-r--r--table.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/table.c b/table.c
index d0aed6c..e996570 100644
--- a/table.c
+++ b/table.c
@@ -2251,6 +2251,7 @@ skip_space(struct table *t, char *line, struct table_linfo *linfo,
Str prevchar = linfo->prevchar;
int w = linfo->length;
int min = 1;
+ char *linez;
if (*line == '<' && line[strlen(line) - 1] == '>') {
if (checkminimum)
@@ -2258,7 +2259,8 @@ skip_space(struct table *t, char *line, struct table_linfo *linfo,
return 0;
}
- while (*line) {
+ linez = line + strlen(line);
+ while (line < linez) {
char *save = line, *c = line;
int ec, len, wlen, plen;
ctype = get_mctype(line);