diff --git a/samgr_server/BUILD.gn b/samgr_server/BUILD.gn index 0807c9c6953f8d8122357b86709224aba2890b0b..2c65c45eab3da678baf9fbbd049e2e0a437c0721 100644 --- a/samgr_server/BUILD.gn +++ b/samgr_server/BUILD.gn @@ -27,6 +27,7 @@ shared_library("server") { "//third_party/bounds_checking_function/include", "//base/security/permission/interfaces/innerkits/permission_lite", "//base/security/permission/services/permission_lite/pms_base/include", + "//foundation/communication/ipc_lite/frameworks/liteipc/include", ] public_deps = [ diff --git a/samgr_server/source/samgr_server.c b/samgr_server/source/samgr_server.c old mode 100755 new mode 100644 index af681ad40536b216368d40def59ac8875b315e6e..d1a03d014b78e4b0841dfd1340cbd11e37a49b52 --- a/samgr_server/source/samgr_server.c +++ b/samgr_server/source/samgr_server.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include "cJSON.h" @@ -167,6 +168,12 @@ static int ProcEndpoint(SamgrServer *server, int32 option, void *origin, IpcIo * SvcIdentity identity = {(uint32)INVALID_INDEX, (uint32)INVALID_INDEX, (uint32)INVALID_INDEX}; (void)GenServiceHandle(&identity, GetCallingTid(origin)); #ifdef __LINUX__ + IpcMsg* data = (IpcMsg*)origin; + if (data == NULL) { + HILOG_ERROR(HILOG_MODULE_SAMGR, "Register Endpoint origin null pointer!"); + return EC_FAILURE; + } + identity.handle = data->target.handle; BinderAcquire(g_server.samgr->context, identity.handle); #endif