Skip to content

DispatchTimeInterval & Date: avoid 32-bit overflows, fix watchOS crashes#2342

Merged
NachoSoto merged 2 commits intomainfrom
nacho/sdk-2974-crash-after-purchase-on-watchos
Mar 16, 2023
Merged

DispatchTimeInterval & Date: avoid 32-bit overflows, fix watchOS crashes#2342
NachoSoto merged 2 commits intomainfrom
nacho/sdk-2974-crash-after-purchase-on-watchos

Conversation

@NachoSoto
Copy link
Copy Markdown
Contributor

Fixes #2338, SDKONCALL-237, [SDK-2974].

Int is actually 32 bits in 32-bit platforms, like watchOS still is (sort of).
This fixes 2 potential Int overflows: Date.millisecondsSince1970 and DispatchTimeInterval arithmetic using nanoseconds.

See also #2340.

Base automatically changed from watchos-tests to main March 16, 2023 20:11
@NachoSoto NachoSoto force-pushed the nacho/sdk-2974-crash-after-purchase-on-watchos branch from 8fee3ad to 7868298 Compare March 16, 2023 20:13
@NachoSoto NachoSoto enabled auto-merge (squash) March 16, 2023 20:13
@NachoSoto NachoSoto merged commit d4ecc7b into main Mar 16, 2023
@NachoSoto NachoSoto deleted the nacho/sdk-2974-crash-after-purchase-on-watchos branch March 16, 2023 20:24
NachoSoto added a commit that referenced this pull request Mar 16, 2023
…` crashes (#2342)

Fixes #2338, [SDKONCALL-237], [SDK-2974].

`Int` is actually 32 bits in 32-bit platforms, like `watchOS` still is
(sort of).
This fixes 2 potential `Int` overflows: `Date.millisecondsSince1970` and
`DispatchTimeInterval` arithmetic using `nanoseconds`.

See also #2340.

[SDKONCALL-237]:
https://revenuecats.atlassian.net/browse/SDKONCALL-237?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash after purchase (watchOS)

2 participants