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

Faulty DATETIME ticksSinceMidnight overflow check #2124

Closed
Marcono1234 opened this issue May 7, 2023 · 1 comment · Fixed by #2129
Closed

Faulty DATETIME ticksSinceMidnight overflow check #2124

Marcono1234 opened this issue May 7, 2023 · 1 comment · Fixed by #2129
Labels
Under Investigation Used for issues under investigation

Comments

@Marcono1234
Copy link

Driver version

4ff4e7e

Problem description

The Integer.MAX_VALUE < ticksSinceMidnight check here is faulty:

if (8 != decryptedValue.length || Integer.MAX_VALUE < ticksSinceMidnight) {

ticksSinceMidnight is an int, so it cannot be > Integer.MAX_VALUE. Maybe the solution here is to change ticksSinceMidnight to long (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.

@tkyc
Copy link
Member

tkyc commented May 8, 2023

Thanks for bringing this up. We'll take a look.

@tkyc tkyc added the Under Investigation Used for issues under investigation label May 8, 2023
@lilgreenbird lilgreenbird linked a pull request May 18, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Under Investigation Used for issues under investigation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants