diff --git a/samgr_server/BUILD.gn b/samgr_server/BUILD.gn index 9a8e377..3e787e1 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", ] deps = [ "//foundation/distributedschedule/samgr_lite:ConfigFiles" ] diff --git a/samgr_server/source/samgr_server.c b/samgr_server/source/samgr_server.c old mode 100755 new mode 100644 index f364cde..bda54ec --- 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