diff --git a/services/distributeddataservice/app/src/session_manager/route_head_handler_impl.cpp b/services/distributeddataservice/app/src/session_manager/route_head_handler_impl.cpp index 513e8e5500150f01ff3cbf8739c450a29a7d20da..50d535996857e28876f199a078c6516c0f4cd346 100644 --- a/services/distributeddataservice/app/src/session_manager/route_head_handler_impl.cpp +++ b/services/distributeddataservice/app/src/session_manager/route_head_handler_impl.cpp @@ -158,6 +158,8 @@ bool RouteHeadHandlerImpl::PackDataBody(uint8_t *data, uint32_t totalLen) ptr += (sizeof(SessionUserPair) + session_.targetUserIds.size() * sizeof(int)); SessionAppId *appPair = reinterpret_cast(ptr); + ptr += sizeof(SessionAppId); + uint32_t appLen = data + totalLen - ptr; appPair->len = HostToNet(appLen); // left size ret = strcpy_s(appPair->appId, appLen, session_.appId.c_str());