Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
dpiDataBuffer__toOracleNumberFromText overruns 1 byte for a negative number whose number of digits is 39. #67
When a negative number whose number of digits is 39 such as
How to check it.
The program prints
Thanks for trying it not only on Linux, but also on macOS.
Sorry, I moved the
Could you change the sample code as follows?
const char *num_str = "-123456789012345678901234567890123456789";
const char *num_str = "-12345678901234567890123456789012345678.9";
The modified code prints:
added a commit
Jul 3, 2018
@kubo, thanks for the clarification. As you can see from the commit I just made, there was code following the check on the number of digits that increased the number of digits, which resulted in the buffer overrun you noted. I have now corrected this. Thanks for pointing this out!