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

Additional null-checks when handling callback names #1918

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

lemnik
Copy link
Contributor

@lemnik lemnik commented Oct 17, 2023

Goal

Avoid possible SIGSEGV when GetStringUTFChars in internal_metrics.c.

Design

  • Sanity check the return value of bsg_safe_get_string_utf_chars in notifyAddCallback and notifyRemoveCallback
  • Further NULL check the api name in bsg_modify_callback_count
  • Limit the strlen check against the maximum expected length

Testing

Relied on existing tests

@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Oct 17, 2023

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1922.67 1696.98
arm64_v8a 680.33 459.15
armeabi_v7a 618.9 393.62
x86 758.14 532.86
x86_64 725.38 504.19

Generated by 🚫 Danger

@lemnik lemnik merged commit f613f51 into next Oct 25, 2023
28 checks passed
@lemnik lemnik deleted the PLAT-11084/metrics-safety branch October 25, 2023 10:52
This was referenced Nov 6, 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