Fix 1546941.

svn path=/trunk/netsurf/; revision=2909
This commit is contained in:
Richard Wilson 2006-09-02 19:03:49 +00:00
parent 1086d53b89
commit 923d9f1365
1 changed files with 10 additions and 6 deletions

View File

@ -457,15 +457,19 @@ bool box_construct_element(xmlNode *n, struct content *content,
/* misc. attributes that can't be handled in box_get_style() */ /* misc. attributes that can't be handled in box_get_style() */
if ((s = (char *) xmlGetProp(n, (const xmlChar *) "colspan"))) { if ((s = (char *) xmlGetProp(n, (const xmlChar *) "colspan"))) {
if (isdigit(s[0])) {
box->columns = strtol(s, NULL, 10); box->columns = strtol(s, NULL, 10);
if (MAX_SPAN < box->columns) if ((MAX_SPAN < box->columns) || (box->columns < 1))
box->columns = 1; box->columns = 1;
}
xmlFree(s); xmlFree(s);
} }
if ((s = (char *) xmlGetProp(n, (const xmlChar *) "rowspan"))) { if ((s = (char *) xmlGetProp(n, (const xmlChar *) "rowspan"))) {
if (isdigit(s[0])) {
box->rows = strtol(s, NULL, 10); box->rows = strtol(s, NULL, 10);
if (MAX_SPAN < box->rows) if ((MAX_SPAN < box->rows) || (box->rows < 1))
box->rows = 1; box->rows = 1;
}
xmlFree(s); xmlFree(s);
} }
if (strcmp((const char *) n->name, "table") == 0) { if (strcmp((const char *) n->name, "table") == 0) {