a6dc93df7ba11ab30c05a266f880ad3f5135d48e
Due to race conditions or programming errors, the NsdManager can attempt to process an asynchronous status message (and issue a callback to the listener) after the listener has already been removed from the NsdManager state. This causes dereferencing of null objects, and a crash. Split out the three async-queue message cases: these are ones in which message.arg2 does not hold an NsdManager array index and the code should not interpret this field as if it were. Add an explicit check for "null listener" (the array index in the message has already been released), log a warning, and exit early. Safeguard accesses to the "NSD service type" string from a (possibly null) NsdServiceInfo object... return a constant "?" string rather than crashing. Bug: 9016259 Change-Id: I40aabdfc65d86fdd0eaac7a1e7e56e6ff69796cf
Description
android_packages_modules_Connectivity
Languages
Java
81.4%
Kotlin
7.7%
AIDL
4.5%
C++
4.5%
C
1.7%
Other
0.1%