From: Fabien Sanglard Date: Thu, 19 Jan 2017 00:43:18 +0000 (-0800) Subject: Fix security vulnerability X-Git-Tag: android-x86-7.1-r1~21^2^2^2^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=45b202513ba7440beaefbf9928f73fb6683dcfbd;p=android-x86%2Fframeworks-native.git Fix security vulnerability Change-Id: I4c9ea3a3177131fa29d2561da71ef18bec3af108 Test: angler, marlin Bug: 32628763 --- diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index a10a8138e3..4e97321dbf 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -2152,8 +2152,7 @@ void SurfaceFlinger::setTransactionState( if (s.client != NULL) { sp binder = IInterface::asBinder(s.client); if (binder != NULL) { - String16 desc(binder->getInterfaceDescriptor()); - if (desc == ISurfaceComposerClient::descriptor) { + if (binder->queryLocalInterface(ISurfaceComposerClient::descriptor) != NULL) { sp client( static_cast(s.client.get()) ); transactionFlags |= setClientStateLocked(client, s.state); } diff --git a/services/surfaceflinger/SurfaceFlinger_hwc1.cpp b/services/surfaceflinger/SurfaceFlinger_hwc1.cpp index 7f3b269f0e..8f6fd660e4 100644 --- a/services/surfaceflinger/SurfaceFlinger_hwc1.cpp +++ b/services/surfaceflinger/SurfaceFlinger_hwc1.cpp @@ -2168,8 +2168,7 @@ void SurfaceFlinger::setTransactionState( if (s.client != NULL) { sp binder = IInterface::asBinder(s.client); if (binder != NULL) { - String16 desc(binder->getInterfaceDescriptor()); - if (desc == ISurfaceComposerClient::descriptor) { + if (binder->queryLocalInterface(ISurfaceComposerClient::descriptor) != NULL) { sp client( static_cast(s.client.get()) ); transactionFlags |= setClientStateLocked(client, s.state); }