oleaut32: In variants check bOverflow to make sure not to accidently overun static buffers in an overflow case (Coverity 313).

This commit is contained in:
Aric Stewart 2008-10-03 10:24:06 -05:00 committed by Alexandre Julliard
parent f7cacc1f09
commit 3b3ed7a020
1 changed files with 5 additions and 4 deletions

View File

@ -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];
}
TRACE("Scaled double value is %16.16g\n", whole);
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)
{