[BUG] Faulty DATETIME
ticksSinceMidnight
overflow check
#34828
Labels
Client
This issue points to a problem in the data-plane of the library.
Cosmos
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
needs-team-triage
Workflow: This issue needs the team to triage.
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Describe the bug
The
Integer.MAX_VALUE < ticksSinceMidnight
check here is faulty:azure-sdk-for-java/sdk/cosmos/azure-cosmos-encryption/src/main/java/com/azure/cosmos/encryption/implementation/mdesrc/cryptography/SqlSerializerUtil.java
Line 521 in e61b855
ticksSinceMidnight
is anint
, so it cannot be> Integer.MAX_VALUE
. Maybe the solution here is to changeticksSinceMidnight
tolong
(and adjust the calculation from* 10
to* 10L
to avoid overflow there).I am not familiar with this code though and am not planning to submit a pull request.
Side note: This looks suspiciously similar to the same bug reported in microsoft/mssql-jdbc#2124.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: