diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-01-25 00:02:27 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-01-25 00:02:27 +0000 |
commit | 285834ebd9ed5296d7ffb0b829b6147841d44711 (patch) | |
tree | 9ccf136fdddb0f28e27c432932027a28a5aad93e | |
parent | 546a6fc167660131c331239d946aec3d111754a7 (diff) | |
download | libcss-285834ebd9ed5296d7ffb0b829b6147841d44711.tar.gz libcss-285834ebd9ed5296d7ffb0b829b6147841d44711.tar.bz2 |
Range check volume values
svn path=/trunk/libcss/; revision=6258
-rw-r--r-- | src/parse/properties.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/parse/properties.c b/src/parse/properties.c index 4297307..38fc58b 100644 --- a/src/parse/properties.c +++ b/src/parse/properties.c @@ -6215,6 +6215,10 @@ css_error parse_volume(css_language *c, if (consumed != token->ilower->len) return CSS_INVALID; + /* Must be between 0 and 100 */ + if (length < 0 || length > F_100) + return CSS_INVALID; + parserutils_vector_iterate(vector, ctx); value = VOLUME_NUMBER; } else { @@ -6227,6 +6231,10 @@ css_error parse_volume(css_language *c, if ((unit & UNIT_PCT) == false) return CSS_INVALID; + /* Must be positive */ + if (length < 0) + return CSS_INVALID; + value = VOLUME_DIMENSION; } |