Gitweb links:

...log 
http://git.netsurf-browser.org/libcss.git/shortlog/53dfc60094f34bbbfd3410de9165396514fd23c2
...commit 
http://git.netsurf-browser.org/libcss.git/commit/53dfc60094f34bbbfd3410de9165396514fd23c2
...tree 
http://git.netsurf-browser.org/libcss.git/tree/53dfc60094f34bbbfd3410de9165396514fd23c2

The branch, master has been updated
       via  53dfc60094f34bbbfd3410de9165396514fd23c2 (commit)
      from  298dd8dd93abfc33c3ab3209f00d78e93fbd041c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/libcss.git/commit/?id=53dfc60094f34bbbfd3410de9165396514fd23c2
commit 53dfc60094f34bbbfd3410de9165396514fd23c2
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Media queries: <ratio> isn't allowed to have 0 numerator or denominator.
    
    The <ratio> value type is a positive (not zero or negative) <integer>
    followed by optional whitespace, followed by a solidus ('/'), followed
    by optional whitespace, followed by a positive <integer>. <ratio>s can
    be ordered or compared by transforming them into the number obtained
    by dividing their first <integer> by their second <integer>.
    
    -- https://www.w3.org/TR/mediaqueries-4/#aspect-ratio

diff --git a/src/parse/mq.c b/src/parse/mq.c
index f3510c1..c5e353d 100644
--- a/src/parse/mq.c
+++ b/src/parse/mq.c
@@ -117,6 +117,10 @@ static css_error mq_parse_ratio(
        num = css__number_from_lwc_string(numerator->idata, true, &num_len);
        den = css__number_from_lwc_string(token->idata, true, &den_len);
 
+       if (num == 0 || den == 0) {
+               return CSS_INVALID;
+       }
+
        *ratio = css_divide_fixed(num, den);
 
        return CSS_OK;


-----------------------------------------------------------------------

Summary of changes:
 src/parse/mq.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/parse/mq.c b/src/parse/mq.c
index f3510c1..c5e353d 100644
--- a/src/parse/mq.c
+++ b/src/parse/mq.c
@@ -117,6 +117,10 @@ static css_error mq_parse_ratio(
        num = css__number_from_lwc_string(numerator->idata, true, &num_len);
        den = css__number_from_lwc_string(token->idata, true, &den_len);
 
+       if (num == 0 || den == 0) {
+               return CSS_INVALID;
+       }
+
        *ratio = css_divide_fixed(num, den);
 
        return CSS_OK;


-- 
Cascading Style Sheets library

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to