Skip to content

Commit 721af5b

Browse files
Steven Morelandwaghpawan
authored andcommitted
libbinder_ndk: allow null codeToFunction.
If this is null (as in the fuzzer), it crashes. Bug: N/A Test: N/A Change-Id: Icd0107d1fada88abad3375d619b672cae64190db
1 parent 0d6e60f commit 721af5b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

libs/binder/ndk/include_cpp/android/binder_interface_utils.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,10 @@ AIBinder_Class* ICInterface::defineClass(const char* interfaceDescriptor,
292292
#if !defined(__ANDROID_PRODUCT__) && \
293293
(defined(__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__) || __ANDROID_API__ >= 36)
294294
if API_LEVEL_AT_LEAST (36, 202504) {
295-
AIBinder_Class_setTransactionCodeToFunctionNameMap(clazz, codeToFunction, functionCount);
295+
if (codeToFunction != nullptr) {
296+
AIBinder_Class_setTransactionCodeToFunctionNameMap(clazz, codeToFunction,
297+
functionCount);
298+
}
296299
}
297300
#else
298301
(void)codeToFunction;

0 commit comments

Comments
 (0)