Prevent segfault with malformed table_alt

Bug-Debian: https://github.com/tats/w3m/issues/24
This commit is contained in:
Tatsuya Kinoshita
2016-08-24 19:05:39 +09:00
parent 4a8d16fc8d
commit a625766382

View File

@@ -760,7 +760,7 @@ do_refill(struct table *tbl, int row, int col, int maxlimit)
struct parsed_tag *tag;
if ((tag = parse_tag(&p, TRUE)) != NULL)
parsedtag_get_value(tag, ATTR_TID, &id);
if (id >= 0 && id < tbl->ntable) {
if (id >= 0 && id < tbl->ntable && tbl->tables[id].ptr) {
int alignment;
TextLineListItem *ti;
struct table *t = tbl->tables[id].ptr;