Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df681340 authored by Pawan Wagh's avatar Pawan Wagh
Browse files

Add check for valid AIBinder_Class_setTransactionCodeToFunctionNameMap

some APEX modules are running into null-deref when calling
AIBinder_Class_setTransactionCodeToFunctionNameMap (artd).
Adding a check for to validate function availability.

Test: m CtsNdkBinderTestCases && atest -c CtsNdkBinderTestCases
Bug: 370091328
Bug: 368303753
Change-Id: I147cca8448c72bbc19ba8cac3cee147f906c7cc4
parent 1456474e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -299,7 +299,8 @@ AIBinder_Class* ICInterface::defineClass(const char* interfaceDescriptor,

#if defined(__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__) || __ANDROID_API__ >= 36
    if API_LEVEL_AT_LEAST (36, 202504) {
        if (codeToFunction != nullptr) {
        if (codeToFunction != nullptr &&
            (&AIBinder_Class_setTransactionCodeToFunctionNameMap != nullptr)) {
            AIBinder_Class_setTransactionCodeToFunctionNameMap(clazz, codeToFunction,
                                                               functionCount);
        }