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

validating successful malloc for lastLocation and classes #969

Merged
merged 1 commit into from
Aug 5, 2021

Conversation

emawby
Copy link
Contributor

@emawby emawby commented Aug 5, 2021

Whenever we use malloc we should validate that it was successful since it could fail. Failing would cause a crash by trying to use an object that is actually NULL.
Fixes #967


This change is Reviewable

Copy link
Member

@jkasten2 jkasten2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @emawby, @Jeasmine, and @nan-li)


-- commits, line 1 at r1 ([raw file](https://github.com/onesignal/onesignal-ios-sdk/blob/03d69ae9a7822a5c693f25982631d70600367c62/-- commits#L1)):
Remove this Commits file.

Copy link
Member

@jkasten2 jkasten2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @emawby, @Jeasmine, and @nan-li)


-- commits, line 1 at r1 ([raw file](https://github.com/onesignal/onesignal-ios-sdk/blob/03d69ae9a7822a5c693f25982631d70600367c62/-- commits#L1)):

Previously, jkasten2 (Josh Kasten) wrote…

Remove this Commits file.

Never mind, this isn't showing up in Github so this is a Reviewable only change / bug.

Copy link
Member

@jkasten2 jkasten2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @emawby, @Jeasmine, and @nan-li)

@emawby emawby merged commit 2a2ec50 into main Aug 5, 2021
@emawby emawby deleted the fix/unvalidated_mallocs branch August 5, 2021 20:53
@emawby emawby mentioned this pull request Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing checks for NULL returned by malloc(3)
2 participants