diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-01-16 09:13:00 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-01-16 09:28:46 +0000 |
commit | c305850c1542761de3ec646de1ad2d4e729ec6d4 (patch) | |
tree | e5a9c1fa21c428233ea479211aaaa06e096036ec /sw | |
parent | f1b0679287a13c184f45c43e51ea3fa4d8fd4c31 (diff) |
ofz#5391 Integer-overflow
Change-Id: Ic252a95cf535bc40560d8e772224871f2b944345
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/html/svxcss1.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx index 53800ef351f2..79151c635062 100644 --- a/sw/source/filter/html/svxcss1.cxx +++ b/sw/source/filter/html/svxcss1.cxx @@ -2080,10 +2080,18 @@ static void ParseCSS1_margin_left( const CSS1Expression *pExpr, break; case CSS1_PIXLENGTH: { - nLeft = static_cast<long>(pExpr->GetNumber()); - long nPHeight = 0; - SvxCSS1Parser::PixelToTwip( nLeft, nPHeight ); - bSet = true; + double fLeft = pExpr->GetNumber(); + if (fLeft < SAL_MAX_INT32/2.0 && fLeft > SAL_MIN_INT32/2.0) + { + nLeft = static_cast<long>(fLeft); + long nPHeight = 0; + SvxCSS1Parser::PixelToTwip( nLeft, nPHeight ); + bSet = true; + } + else + { + SAL_WARN("sw.html", "out-of-size pxlength: " << fLeft); + } } break; case CSS1_PERCENTAGE: |