craftzdog / craftzdog/react-native-quick-base64

Crash with invalid base64 data

Open
#18 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
464
Forks
40
PR merge metrics
No merged PRs in 30d

Description

This crash always happens if the base64 data is not 100% valid. This happens on Android, I didn't test iOS.

toByteArray("YXNkZgo=") // works
toByteArray("YXNkZgo") // crash
toByteArray("YXNkZgo==") // crash

If it's even more corrupted, with for example invalid chars like ,&* or so, it crashes as well.

01-20 15:32:48.194  3406  3406 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-20 15:32:48.194  3406  3406 F DEBUG   : Build fingerprint: 'Android/sdk_phone_x86/generic_x86:11/RSR1.210210.001.A1/7193139:userdebug/dev-keys'
01-20 15:32:48.194  3406  3406 F DEBUG   : Revision: '0'
01-20 15:32:48.194  3406  3406 F DEBUG   : ABI: 'x86'
01-20 15:32:48.194  3406  3406 F DEBUG   : Timestamp: 2023-01-20 15:32:48+0100
01-20 15:32:48.194  3406  3406 F DEBUG   : pid: 3238, tid: 3298, name: mqt_js  >>> com.jblapp <<<
01-20 15:32:48.194  3406  3406 F DEBUG   : uid: 10136
01-20 15:32:48.194  3406  3406 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
01-20 15:32:48.194  3406  3406 F DEBUG   :     eax 00000000  ebx 00000ca6  ecx 00000ce2  edx 00000006
01-20 15:32:48.194  3406  3406 F DEBUG   :     edi e739c81e  esi b426a940
01-20 15:32:48.194  3406  3406 F DEBUG   :     ebp e99beb90  esp b426a8e8  eip e99beb99
01-20 15:32:48.253  3406  3406 F DEBUG   : backtrace:
01-20 15:32:48.253  3406  3406 F DEBUG   :       #00 pc 00000b99  [vdso] (__kernel_vsyscall+9)
01-20 15:32:48.253  3406  3406 F DEBUG   :       #01 pc 0005ad68  /apex/com.android.runtime/lib/bionic/libc.so (syscall+40) (BuildId: 6e3a0180fa6637b68c0d181c343e6806)
01-20 15:32:48.253  3406  3406 F DEBUG   :       #02 pc 00076511  /apex/com.android.runtime/lib/bionic/libc.so (abort+209) (BuildId: 6e3a0180fa6637b68c0d181c343e6806)
01-20 15:32:48.253  3406  3406 F DEBUG   :       #03 pc 000b783c  /data/app/~~fW1sq5DMEO4DOlGQyVjpDw==/com.jblapp-J8UQIcQPuouGruyooLoyiA==/lib/x86/libc++_shared.so (BuildId: 5d632b8bdfc3c6b26faedb2f035955edb77efe9b)
...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Android crash through the toByteArray entry point with the valid, missing-padding, extra-padding, and invalid-character examples in the issue. Inspect the implementation and verify that each invalid input no longer crashes, then add or run the relevant checks available in the project.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, cpp, react-native
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.