Skip to content

Commit dc05f5d

Browse files
committed
Fix uninitialized values when parsing zeroes
`0.e0` will not initialize the significant reference argument. `00[..]0.[0...]` will not initialize exponent nor significant.
1 parent 43f4a45 commit dc05f5d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/boost/charconv/detail/parser.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ inline from_chars_result parser(const char* first, const char* last, bool& sign,
252252

253253
if (next == last)
254254
{
255+
significand = 0;
256+
exponent = 0;
255257
return {last, std::errc()};
256258
}
257259
}
@@ -366,6 +368,8 @@ inline from_chars_result parser(const char* first, const char* last, bool& sign,
366368
significand += 1;
367369
}
368370
}
371+
else
372+
significand = 0;
369373
}
370374
else
371375
{

0 commit comments

Comments
 (0)