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"))) {
box->columns = strtol(s, NULL, 10); if (isdigit(s[0])) {
if (MAX_SPAN < box->columns) box->columns = strtol(s, NULL, 10);
box->columns = 1; if ((MAX_SPAN < box->columns) || (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"))) {
box->rows = strtol(s, NULL, 10); if (isdigit(s[0])) {
if (MAX_SPAN < box->rows) box->rows = strtol(s, NULL, 10);
box->rows = 1; if ((MAX_SPAN < box->rows) || (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) {