-
Notifications
You must be signed in to change notification settings - Fork 75
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
dpiDataBuffer__toOracleNumberFromText overruns 1 byte for a negative number whose number of digits is 39. #67
Comments
And I just tried on macOS as well and don't see these results there either. |
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"; to: const char *num_str = "-12345678901234567890123456789012345678.9"; The modified code prints:
The |
No issues with 11.2 or 12.2 client to an 18c DB on Linux. The appendSentinel check wasn't triggered. |
The data "-12345678901234567890123456789012345678.9" does produce output "offset = 22" on Linux x64 with 11.2 & 12.2 clients. |
@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! |
When a negative number whose number of digits is 39 such as
-123456789012345678901234567890123456789
is converted to an Oracle number,dpiDataBuffer__toOracleNumberFromText()
overruns 1 byte.How to check it.
Edited: The posted file doesn't provide the issue. Change a number in the file as my next post to reproduce it.
The program prints
offset = 22
. So the sentinel 102 was written at 23th byte. However the size of Oracle number is 22.The text was updated successfully, but these errors were encountered: