summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorRichard Wilson <rjw@netsurf-browser.org>2006-09-02 19:03:49 +0000
committerRichard Wilson <rjw@netsurf-browser.org>2006-09-02 19:03:49 +0000
commit923d9f13659db97d1942e7daffdf9df3877ece96 (patch)
treeb23a724a10126a160870b8e5ceb227958ea90e01 /render
parent1086d53b89a9ba1bf886afb554d2fc66bf6e4d6e (diff)
downloadnetsurf-923d9f13659db97d1942e7daffdf9df3877ece96.tar.gz
netsurf-923d9f13659db97d1942e7daffdf9df3877ece96.tar.bz2
Fix 1546941.
svn path=/trunk/netsurf/; revision=2909
Diffstat (limited to 'render')
-rw-r--r--render/box_construct.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/render/box_construct.c b/render/box_construct.c
index b61cb5d24..d37d357c3 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -457,15 +457,19 @@ bool box_construct_element(xmlNode *n, struct content *content,
/* misc. attributes that can't be handled in box_get_style() */
if ((s = (char *) xmlGetProp(n, (const xmlChar *) "colspan"))) {
- box->columns = strtol(s, NULL, 10);
- if (MAX_SPAN < box->columns)
- box->columns = 1;
+ if (isdigit(s[0])) {
+ box->columns = strtol(s, NULL, 10);
+ if ((MAX_SPAN < box->columns) || (box->columns < 1))
+ box->columns = 1;
+ }
xmlFree(s);
}
if ((s = (char *) xmlGetProp(n, (const xmlChar *) "rowspan"))) {
- box->rows = strtol(s, NULL, 10);
- if (MAX_SPAN < box->rows)
- box->rows = 1;
+ if (isdigit(s[0])) {
+ box->rows = strtol(s, NULL, 10);
+ if ((MAX_SPAN < box->rows) || (box->rows < 1))
+ box->rows = 1;
+ }
xmlFree(s);
}
if (strcmp((const char *) n->name, "table") == 0) {