mirror of
https://github.com/openharmony/distributedhardware_distributed_input.git
synced 2026-07-19 17:43:35 -04:00
fix null pointer is not verified
Signed-off-by: liqiao49 <liqiao49@huawei.com>
This commit is contained in:
@@ -138,6 +138,10 @@ int32_t DistributedInputSinkStub::NotifyStopDScreenInner(MessageParcel &data, Me
|
||||
int32_t DistributedInputSinkStub::RegisterSharingDhIdListenerInner(MessageParcel &data, MessageParcel &reply,
|
||||
MessageOption &option)
|
||||
{
|
||||
if (data.ReadRemoteObject() == nullptr) {
|
||||
DHLOGE("RegisterSharingDhIdListenerInner failed, data.ReadRemoteObject is nullptr.");
|
||||
return ERR_DH_INPUT_SINK_STUB_REGISTER_SHARING_DHID_LISTENER_FAIL;
|
||||
}
|
||||
sptr<ISharingDhIdListener> listener = iface_cast<ISharingDhIdListener>(data.ReadRemoteObject());
|
||||
int32_t ret = RegisterSharingDhIdListener(listener);
|
||||
if (!reply.WriteInt32(ret)) {
|
||||
|
||||
Reference in New Issue
Block a user