mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-27 10:50:41 +00:00
fix code revice and check ptr
Signed-off-by: shenjiahao5 <shenjiahao5@huawei.com>
This commit is contained in:
parent
b22a55e22e
commit
a53480af71
@ -571,7 +571,8 @@ int64_t GetActiveAuthIdByConnInfo(const AuthConnInfo *connInfo, bool judgeTimeOu
|
||||
auth[i] = NULL;
|
||||
continue;
|
||||
}
|
||||
if ((currentTime - auth[i]->lastActiveTime >= MAX_AUTH_VALID_PERIOD) && judgeTimeOut) {
|
||||
if (judgeTimeOut && (currentTime > auth[i]->lastActiveTime)
|
||||
&& (currentTime - auth[i]->lastActiveTime >= MAX_AUTH_VALID_PERIOD)) {
|
||||
AUTH_LOGI(AUTH_CONN, "auth manager timeout. authId=%{public}" PRId64, auth[i]->authId);
|
||||
auth[i] = NULL;
|
||||
}
|
||||
|
@ -346,6 +346,10 @@ static int32_t GetEnhancedP2pAuthKey(const char *udidHash, AuthSessionInfo *info
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
AuthManager *auth = GetAuthManagerByAuthId(authHandle.authId);
|
||||
if (auth == NULL) {
|
||||
AUTH_LOGE(AUTH_FSM, "get AuthManager fail");
|
||||
return SOFTBUS_AUTH_NOT_FOUND;
|
||||
}
|
||||
int32_t index;
|
||||
SessionKey sessionKey;
|
||||
(void)memset_s(&sessionKey, sizeof(SessionKey), 0, sizeof(SessionKey));
|
||||
|
@ -74,6 +74,7 @@ static void UpdateDeviceNameInfo(const char *udid, const char *oldDeviceName)
|
||||
NodeBasicInfo basic;
|
||||
if (memset_s(&basic, sizeof(NodeBasicInfo), 0, sizeof(NodeBasicInfo)) != EOK) {
|
||||
LNN_LOGE(LNN_LEDGER, "memset_s basic fail!");
|
||||
return;
|
||||
}
|
||||
if (LnnGetBasicInfoByUdid(udid, &basic) != SOFTBUS_OK) {
|
||||
LNN_LOGE(LNN_LEDGER, "GetBasicInfoByUdid fail.");
|
||||
|
Loading…
Reference in New Issue
Block a user