You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know there are several other issues open on this related topic,
but I believe this would be slightly solution - hard fail please,
This bit of code will cause ryu to overflow its buffer:
d2fixed(1.0, 5000);
d2exp() will also do this,
both allocate a buffer = malloc(2000)
and then will blindly write as many characters as demanded by the precision parameter.
In my example requests 5000 precision, and ryu will try and write 5003 characters into the 2000 byte buffers.
I think you could set a hard max precision allowed, and abort() or fail or whatever.
Anything would be better than overflowing the buffer!
The text was updated successfully, but these errors were encountered:
Hi,
I know there are several other issues open on this related topic,
but I believe this would be slightly solution - hard fail please,
This bit of code will cause ryu to overflow its buffer:
d2fixed(1.0, 5000);
d2exp() will also do this,
both allocate a buffer = malloc(2000)
and then will blindly write as many characters as demanded by the precision parameter.
In my example requests 5000 precision, and ryu will try and write 5003 characters into the 2000 byte buffers.
I think you could set a hard max precision allowed, and abort() or fail or whatever.
Anything would be better than overflowing the buffer!
The text was updated successfully, but these errors were encountered: