ucrtbase: Fix end pointer setting in parse_double on partial nan/infinity match.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Piotr Caban 2020-01-07 15:35:52 +01:00 committed by Alexandre Julliard
parent 6d70b1a66e
commit 3fc3d24c3c
2 changed files with 6 additions and 0 deletions

View File

@ -706,7 +706,11 @@ double parse_double(MSVCRT_wchar_t (*get)(void *ctx), void (*unget)(void *ctx),
if(keep) {
if (str_match == _infinity) return sign*INFINITY;
if (str_match == _nan) return sign*NAN;
} else if(found_sign) {
unget(ctx);
}
return make_double(sign, exp, d, ROUND_ZERO, err);
}
if(nch == '0') {

View File

@ -144,6 +144,8 @@ static void test_strtod(void)
test_strtod_str("inf42", INFINITY, 3);
test_strtod_str("inffoo", INFINITY, 3);
test_strtod_str("infini", INFINITY, 3);
test_strtod_str("input", 0, 0);
test_strtod_str("-input", 0, 0);
test_strtod_str("NAN", NAN, 3);
test_strtod_str("nan", NAN, 3);