Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buffer overflows in to_chars for std::bfloat16_t #162

Closed
gpeterhoff opened this issue Feb 10, 2024 · 0 comments · Fixed by #161
Closed

buffer overflows in to_chars for std::bfloat16_t #162

gpeterhoff opened this issue Feb 10, 2024 · 0 comments · Fixed by #161

Comments

@gpeterhoff
Copy link

Hi Matt,
if the buffer is too small and value = ±inf/±(s)nan there will be buffer overflows again. Here:

using buffer_type = std::array<char, 2>;
value = -L::quiet_NaN();
std::bfloat16_t
(std  , scientific)	{}	(2, Value too large for defined data type)
(boost, scientific)	BOF!	(9, Success)

(std  , fixed     )	{}	(2, Value too large for defined data type)
(boost, fixed     )	BOF!	(9, Success)

(std  , hex       )	{}	(2, Value too large for defined data type)
(boost, hex       )	{}	(2, Numerical result out of range)

(std  , general   )	{}	(2, Value too large for defined data type)
(boost, general   )	BOF!	(9, Success)

regards
Gero

@mborland mborland linked a pull request Feb 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant