diff --git a/adapter/common/openssl/softbus_aes_encrypt.c b/adapter/common/openssl/softbus_aes_encrypt.c
index e17ef601b..5d1bc84e5 100755
--- a/adapter/common/openssl/softbus_aes_encrypt.c
+++ b/adapter/common/openssl/softbus_aes_encrypt.c
@@ -379,7 +379,7 @@ static int32_t OpensslAesGcmDecrypt(
return SOFTBUS_MEM_ERR;
}
if (EVP_CIPHER_CTX_ctrl(
- ctx, EVP_CTRL_GCM_SET_TAG, AES_GCM_TAG_LEN, (void *)(srcData + (srcDataLen - AES_GCM_TAG_LEN))) != 1) {
+ ctx, EVP_CTRL_GCM_SET_TAG, AES_GCM_TAG_LEN, (void *)(srcData + (srcDataLen - AES_GCM_TAG_LEN))) != 1) {
COMM_LOGE(COMM_ADAPTER, "EVP_CTRL_GCM_SET_TAG failed.");
EVP_CIPHER_CTX_free(ctx);
return SOFTBUS_ERR;
diff --git a/core/common/dfx/hisysevent_adapter/softbus_hisysevt_connreporter.c b/core/common/dfx/hisysevent_adapter/softbus_hisysevt_connreporter.c
index 2a8b46052..d858bbbc2 100644
--- a/core/common/dfx/hisysevent_adapter/softbus_hisysevt_connreporter.c
+++ b/core/common/dfx/hisysevent_adapter/softbus_hisysevt_connreporter.c
@@ -566,7 +566,7 @@ int32_t SoftbusRecordConnResult(uint32_t pId, SoftBusConnType connType, SoftBusC
SoftBusMutexUnlock(&g_connResApiLock);
errCode = GetErrorCodeEx(errCode);
COMM_CHECK_AND_RETURN_RET_LOGE(SoftbusReportConnFault(connType, errCode, pkgName) == SOFTBUS_OK, SOFTBUS_ERR,
- COMM_EVENT, "report conn fault event fail!");
+ COMM_EVENT, "report conn fault event fail!");
return SOFTBUS_OK;
}
@@ -580,7 +580,7 @@ int32_t SoftbusRecordProccessDuration(uint32_t pId, SoftBusConnType connType, So
}
SoftbusRecordConnResult(pId, connType, status, stepTime->totalTime, errCode);
COMM_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&g_procStepLock) == SOFTBUS_OK, SOFTBUS_ERR, COMM_EVENT,
- "record g_procStepLock fail");
+ "record g_procStepLock fail");
for (ProcessStep i = NEGOTIATION_STEP; i < STEP_BUTT; i++) {
uint64_t costTime = stepTime->connGroupTime;
switch (i) {
@@ -625,7 +625,7 @@ static int32_t InitConnEvtMutexLock(void)
{
SoftBusMutexAttr mutexAttr = {SOFTBUS_MUTEX_RECURSIVE};
COMM_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexInit(&g_pIdOfNameLock, &mutexAttr) == SOFTBUS_OK, SOFTBUS_ERR,
- COMM_EVENT, "init pId of name lock fail");
+ COMM_EVENT, "init pId of name lock fail");
int32_t nRet = SoftBusMutexInit(&g_connResApiLock, &mutexAttr);
if (nRet != SOFTBUS_OK) {
COMM_LOGE(COMM_EVENT, "init conn res api lock fail");
diff --git a/core/common/dfx/hisysevent_adapter/softbus_hisysevt_discreporter.c b/core/common/dfx/hisysevent_adapter/softbus_hisysevt_discreporter.c
index 1518700f9..187aedc51 100644
--- a/core/common/dfx/hisysevent_adapter/softbus_hisysevt_discreporter.c
+++ b/core/common/dfx/hisysevent_adapter/softbus_hisysevt_discreporter.c
@@ -501,7 +501,7 @@ int32_t SoftbusRecordDiscBleRssi(int32_t rssi)
return SOFTBUS_INVALID_PARAM;
}
COMM_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&g_bleRssiRangeLock) == SOFTBUS_OK, SOFTBUS_LOCK_ERR, COMM_EVENT,
- "ble rssi range lock fail");
+ "ble rssi range lock fail");
size_t rangeId = (MAX_RANGE_ID - rssi) / INTERVAL_OF_RSSI;
g_bleRssiRangeId[rangeId] = rangeId;
@@ -523,7 +523,7 @@ static int32_t InitDiscEvtMutexLock(void)
{
SoftBusMutexAttr mutexAttr = {SOFTBUS_MUTEX_RECURSIVE};
COMM_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexInit(&g_discDetailLock, &mutexAttr) == SOFTBUS_OK, SOFTBUS_ERR,
- COMM_EVENT, "init disc detail lock fail");
+ COMM_EVENT, "init disc detail lock fail");
int32_t nRet = SoftBusMutexInit(&g_bleRssiRangeLock, &mutexAttr);
if (nRet != SOFTBUS_OK) {
COMM_LOGE(COMM_EVENT, "init ble rssi range lock fail");
diff --git a/interfaces/inner_kits/transport/inner_session.h b/interfaces/inner_kits/transport/inner_session.h
index fe03d8df4..412c09acc 100644
--- a/interfaces/inner_kits/transport/inner_session.h
+++ b/interfaces/inner_kits/transport/inner_session.h
@@ -57,7 +57,8 @@ extern "C" {
* @param addrInfo Indicates the pointer to the address information for the connection between devices.
* @param num Indicates the number of device connection records.
* @param mixAddr Indicates the pointer to the connection address information.
- * If the address information passed by addrInfo is invalid, this parameter can be used to obtain the connection information.
+ * If the address information passed by addrInfo is invalid,
+ * this parameter can be used to obtain the connection information.
*
* @return Returns SOFTBUS_INVALID_PARAM if invalid parameters are detected.
* @return Returns INVALID_SESSION_ID if the session ID is invalid.
diff --git a/sdk/transmission/session/src/client_trans_session_service.c b/sdk/transmission/session/src/client_trans_session_service.c
index 7e5bd7010..8fcd2f2cb 100644
--- a/sdk/transmission/session/src/client_trans_session_service.c
+++ b/sdk/transmission/session/src/client_trans_session_service.c
@@ -350,7 +350,7 @@ static int IsValidAddrInfoArr(const ConnectionAddr *addrInfo, int num)
int32_t wifiIndex = -1;
int32_t brIndex = -1;
int32_t bleIndex = -1;
- for (int32_t index = 0; index < num; index++) {
+ for (int32_t index = 0; num > index; index++) {
if ((addrInfo[index].type == CONNECTION_ADDR_ETH || addrInfo[index].type == CONNECTION_ADDR_WLAN) &&
wifiIndex < 0) {
wifiIndex = index;
diff --git a/sdk/transmission/trans_channel/udp/stream/libsoftbus_stream/raw_stream_data.h b/sdk/transmission/trans_channel/udp/stream/libsoftbus_stream/raw_stream_data.h
index f115fe844..770351729 100644
--- a/sdk/transmission/trans_channel/udp/stream/libsoftbus_stream/raw_stream_data.h
+++ b/sdk/transmission/trans_channel/udp/stream/libsoftbus_stream/raw_stream_data.h
@@ -27,7 +27,7 @@ namespace SoftBus {
class RawStreamData : public IStream {
public:
RawStreamData() = default;
- virtual ~RawStreamData() override = default;
+ ~RawStreamData() override = default;
static constexpr int BYTE_TO_BIT = 8;
static constexpr int INT_TO_BYTE = 0xff;
static constexpr int FRAME_HEADER_LEN = 4;
diff --git a/sdk/transmission/trans_channel/udp/stream/libsoftbus_stream/stream_common_data.h b/sdk/transmission/trans_channel/udp/stream/libsoftbus_stream/stream_common_data.h
index adf4187e1..7900893d3 100644
--- a/sdk/transmission/trans_channel/udp/stream/libsoftbus_stream/stream_common_data.h
+++ b/sdk/transmission/trans_channel/udp/stream/libsoftbus_stream/stream_common_data.h
@@ -32,7 +32,7 @@ public:
StreamCommonData() = default;
StreamCommonData(uint32_t streamId, uint16_t seq, const StreamFrameInfo& frameInfo);
- virtual ~StreamCommonData() override = default;
+ ~StreamCommonData() override = default;
// 应用调用生成流数据。
int InitStreamData(std::unique_ptr inputBuf, ssize_t bufSize, std::unique_ptr inputExt,
diff --git a/sdk/transmission/trans_channel/udp/stream/libsoftbus_stream/stream_manager.h b/sdk/transmission/trans_channel/udp/stream/libsoftbus_stream/stream_manager.h
index dd3fe220d..ce0830c81 100644
--- a/sdk/transmission/trans_channel/udp/stream/libsoftbus_stream/stream_manager.h
+++ b/sdk/transmission/trans_channel/udp/stream/libsoftbus_stream/stream_manager.h
@@ -38,7 +38,7 @@ public:
explicit StreamSocketListener(std::shared_ptr streamListener)
: listener_(streamListener) {}
StreamSocketListener() = delete;
- virtual ~StreamSocketListener() override= default;
+ ~StreamSocketListener() override = default;
void OnStreamReceived(std::unique_ptr stream) override
{
listener_->OnStreamReceived(std::move(stream));
diff --git a/sdk/transmission/trans_channel/udp/stream/libsoftbus_stream/stream_msg_manager.h b/sdk/transmission/trans_channel/udp/stream/libsoftbus_stream/stream_msg_manager.h
index 2eec59429..903163396 100644
--- a/sdk/transmission/trans_channel/udp/stream/libsoftbus_stream/stream_msg_manager.h
+++ b/sdk/transmission/trans_channel/udp/stream/libsoftbus_stream/stream_msg_manager.h
@@ -27,7 +27,7 @@ namespace SoftBus {
class StreamMsgManager : public std::enable_shared_from_this, public IStreamMsgManager {
public:
StreamMsgManager() = default;
- virtual ~StreamMsgManager() override= default;
+ ~StreamMsgManager() override = default;
bool Send(const HistoryStats &stats);
void Recv(const HistoryStats &stats);