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

Avoid possible double-free in setStaticJsonData #1950

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

lemnik
Copy link
Contributor

@lemnik lemnik commented Nov 29, 2023

Goal

Avoid possible double-free in setStaticJsonData when it is called from multiple concurrent threads

Changeset

  • Replaced the standard const char* pointer with an atomic pointer in order to ensure that a double free is not possible.
  • Added a NULL check to the result of strdup
  • Replace the strlen(data) == 0 with a quicker de reference check

Testing

Relied on existing tests as this specific condition has no reliable repro

@lemnik lemnik requested a review from kstenerud November 29, 2023 14:16
@bugsnagbot
Copy link
Collaborator

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1843.49 1668.64
arm64_v8a 626.95 450.82
armeabi_v7a 561.42 385.29
x86 700.66 524.53
x86_64 671.99 495.86

Generated by 🚫 Danger

@lemnik lemnik merged commit dea908f into next Dec 4, 2023
6 checks passed
@lemnik lemnik deleted the PLAT-11264/fix_setStaticJsonData branch December 4, 2023 13:39
@ghost ghost mentioned this pull request Dec 5, 2023
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.

3 participants