From e53fa281357edc934e6362facbcb9b065dae8e90 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Tue, 15 May 2018 14:23:06 +0200 Subject: Check for infinite value in txFormatNumberFunctionCall. --- dom/xslt/xslt/txFormatNumberFunctionCall.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dom/xslt') diff --git a/dom/xslt/xslt/txFormatNumberFunctionCall.cpp b/dom/xslt/xslt/txFormatNumberFunctionCall.cpp index a4d4b8fb0..674fb553c 100644 --- a/dom/xslt/xslt/txFormatNumberFunctionCall.cpp +++ b/dom/xslt/xslt/txFormatNumberFunctionCall.cpp @@ -265,6 +265,12 @@ txFormatNumberFunctionCall::evaluate(txIEvalContext* aContext, value = fabs(value) * multiplier; + // Make sure the multiplier didn't push value to infinity. + if (value == mozilla::PositiveInfinity()) { + return aContext->recycler()->getStringResult(format->mInfinity, + aResult); + } + // Prefix nsAutoString res(prefix); -- cgit v1.2.3