aboutsummaryrefslogtreecommitdiffstats
path: root/table.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-12-05 13:25:14 +0000
committerTatsuya Kinoshita <tats@debian.org>2017-01-06 13:06:06 +0000
commita197df28ffd01a4031bf4de0b290235ccb73e82c (patch)
tree4b0340fe698bd9d2c960bd5a5e04f23faea9bc85 /table.c
parentPrevent array index out of bounds for tabattr in feed_table_tag() (diff)
downloadw3m-a197df28ffd01a4031bf4de0b290235ccb73e82c.tar.gz
w3m-a197df28ffd01a4031bf4de0b290235ccb73e82c.zip
Prevent negative array index in set_integered_width()
Bug-Debian: https://github.com/tats/w3m/issues/70 Origin: https://anonscm.debian.org/cgit/collab-maint/w3m.git/commit/?id=a3ed914b0cfc3750e0eb57bb21e2ec6f86ca94f0
Diffstat (limited to '')
-rw-r--r--table.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/table.c b/table.c
index 1a37772..84e4bf6 100644
--- a/table.c
+++ b/table.c
@@ -961,7 +961,7 @@ set_integered_width(struct table *t, double *dwidth, short *iwidth)
for (step = 0; step < 2; step++) {
for (i = 0; i <= t->maxcol; i += n) {
int nn;
- char *idx;
+ short *idx;
double nsum;
if (sum < 0.5)
return;
@@ -982,7 +982,7 @@ set_integered_width(struct table *t, double *dwidth, short *iwidth)
(double)rulewidth - mod[ii] > 0.5)
fixed[ii] = 1;
}
- idx = NewAtom_N(char, n);
+ idx = NewAtom_N(short, n);
for (k = 0; k < cell->maxcell; k++) {
int kk, w, width, m;
j = cell->index[k];