summaryrefslogtreecommitdiff
path: root/src/parse
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-01-24 13:17:23 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-01-24 13:17:23 +0000
commit76d4f965aefaaddbf912e41e6476986e54b1e4d4 (patch)
tree5593125871878a2119d4bd51a756cf29fb9f7f1c /src/parse
parent6fc9d00e80afacf71233b908db213103cb013db5 (diff)
downloadlibcss-76d4f965aefaaddbf912e41e6476986e54b1e4d4.tar.gz
libcss-76d4f965aefaaddbf912e41e6476986e54b1e4d4.tar.bz2
Ensure max-width and min-width values are positive
svn path=/trunk/libcss/; revision=6229
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/properties.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/parse/properties.c b/src/parse/properties.c
index 69ff9f9..f9b8c4c 100644
--- a/src/parse/properties.c
+++ b/src/parse/properties.c
@@ -3772,6 +3772,10 @@ css_error parse_max_width(css_language *c,
if (unit & UNIT_ANGLE || unit & UNIT_TIME || unit & UNIT_FREQ)
return CSS_INVALID;
+ /* Negative values are illegal */
+ if (length < 0)
+ return CSS_INVALID;
+
value = MAX_WIDTH_SET;
}
@@ -3898,6 +3902,10 @@ css_error parse_min_width(css_language *c,
if (unit & UNIT_ANGLE || unit & UNIT_TIME || unit & UNIT_FREQ)
return CSS_INVALID;
+ /* Negative values are illegal */
+ if (length < 0)
+ return CSS_INVALID;
+
value = MIN_WIDTH_SET;
}