Set android app config to Deploy: APK from app bundle
Run the app on non rooted device.
Issue:
char* filePaths[NUM_LIBS] is not set to null by default and on non-rooted devices, it s not getting filled with file path pointer. If the app is deployed from bundle, this variable gets filled with some random garbage address. Since we have only null check before freeing the memory, the code tries to free some random garbage address and crashes.
This works fine with rooted devices and if the app is deployed as apk on non-rooted devices
Solution:
Set a default null char to the array values like, char* filePaths[NUM_LIBS] = {'\0'};
Steps to reproduce:
Deploy: APK from app bundle
Issue:
char* filePaths[NUM_LIBS]
is not set to null by default and on non-rooted devices, it s not getting filled with file path pointer. If the app is deployed from bundle, this variable gets filled with some random garbage address. Since we have only null check before freeing the memory, the code tries to free some random garbage address and crashes.This works fine with rooted devices and if the app is deployed as apk on non-rooted devices
Solution:
Set a default null char to the array values like,
char* filePaths[NUM_LIBS] = {'\0'};