diff options
| author | Tatsuya Kinoshita <tats@debian.org> | 2016-12-05 13:25:14 +0000 | 
|---|---|---|
| committer | Tatsuya Kinoshita <tats@debian.org> | 2016-12-05 13:25:14 +0000 | 
| commit | a3ed914b0cfc3750e0eb57bb21e2ec6f86ca94f0 (patch) | |
| tree | c194f38319c2b6f85ce0fa6018ab982d4e2f30a3 | |
| parent | Prevent array index out of bounds for tabattr in feed_table_tag() (diff) | |
| download | w3m-a3ed914b0cfc3750e0eb57bb21e2ec6f86ca94f0.tar.gz w3m-a3ed914b0cfc3750e0eb57bb21e2ec6f86ca94f0.zip | |
Prevent negative array index in set_integered_width()
Bug-Debian: https://github.com/tats/w3m/issues/70
| -rw-r--r-- | table.c | 4 | 
1 files changed, 2 insertions, 2 deletions
| @@ -960,7 +960,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; @@ -981,7 +981,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]; | 
