Commit 3b3ed7a0 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

oleaut32: In variants check bOverflow to make sure not to accidently overun…

oleaut32: In variants check bOverflow to make sure not to accidently overun static buffers in an overflow case (Coverity 313).
parent f7cacc1f
......@@ -2322,7 +2322,7 @@ HRESULT WINAPI VarNumFromParseNum(NUMPARSE *pNumprs, BYTE *rgbDig,
whole = whole * dblMultipliers[10];
multiplier10 -= 10;
}
if (multiplier10)
if (multiplier10 && !bOverflow)
{
if (whole > dblMaximums[multiplier10])
{
......@@ -2333,9 +2333,10 @@ HRESULT WINAPI VarNumFromParseNum(NUMPARSE *pNumprs, BYTE *rgbDig,
whole = whole * dblMultipliers[multiplier10];
}
if (!bOverflow)
TRACE("Scaled double value is %16.16g\n", whole);
while (divisor10 > 10)
while (divisor10 > 10 && !bOverflow)
{
if (whole < dblMinimums[10] && whole != 0)
{
......@@ -2346,7 +2347,7 @@ HRESULT WINAPI VarNumFromParseNum(NUMPARSE *pNumprs, BYTE *rgbDig,
whole = whole / dblMultipliers[10];
divisor10 -= 10;
}
if (divisor10)
if (divisor10 && !bOverflow)
{
if (whole < dblMinimums[divisor10] && whole != 0)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment