summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/Script.java
diff options
context:
space:
mode:
authorDave Platt <dplatt@google.com>2014-02-27 16:16:20 -0800
committerDave Platt <dplatt@google.com>2014-03-04 13:25:02 -0800
commit3fc376b7336cfbddbb10ce3f93a853a927f6513a (patch)
treeeb35fa80032254e24616d9caee838c004287512a /rs/java/android/renderscript/Script.java
parenta0b4d0ce471cf10888bac4d4ec5b97fd562ad756 (diff)
Harden NsdManager against null-dereference crashes
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
Diffstat (limited to 'rs/java/android/renderscript/Script.java')
0 files changed, 0 insertions, 0 deletions