From f57a6bf24ddca6f54adc838061e7efdd2387c5d3 Mon Sep 17 00:00:00 2001 From: maoyongxing Date: Mon, 1 Aug 2022 14:59:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DL0=E9=83=A8=E5=88=86=E5=91=8A?= =?UTF-8?q?=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cert_mgr_service/services/core/cert/cert_service.c | 2 +- cert_mgr_service/services/core/network/cert_channel.c | 2 +- cert_mgr_service/services/core/network/cert_network.c | 4 ++-- cert_mgr_service/services/core/network/cert_tls.c | 2 +- cert_mgr_service/services/core/utils/cert_utils_file.c | 2 +- cert_mgr_service/services/oem_adapter/src/cert_mgr_oem_file.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cert_mgr_service/services/core/cert/cert_service.c b/cert_mgr_service/services/core/cert/cert_service.c index df757ac..e1a645e 100644 --- a/cert_mgr_service/services/core/cert/cert_service.c +++ b/cert_mgr_service/services/core/cert/cert_service.c @@ -33,7 +33,7 @@ pthread_mutex_t g_mtx_certmgr = PTHREAD_MUTEX_INITIALIZER; -static int32_t ConnectWiseDevice() +static int32_t ConnectWiseDevice(void) { CERT_LOG_DEBUG("[ConnectWiseDevice] Begin."); int32_t ret = 0; diff --git a/cert_mgr_service/services/core/network/cert_channel.c b/cert_mgr_service/services/core/network/cert_channel.c index 952f566..4705d21 100644 --- a/cert_mgr_service/services/core/network/cert_channel.c +++ b/cert_mgr_service/services/core/network/cert_channel.c @@ -165,7 +165,7 @@ int32_t TLSConnect(TLSSession* session) int32_t TLSWrite(const TLSSession* session, const uint8_t* buf, size_t len) { - if (session == NULL || buf == NULL || len < 0 || len > MAX_REQUEST_SIZE) { + if (session == NULL || buf == NULL || len > MAX_REQUEST_SIZE) { return ERR_NET_INVALID_ARG; } int32_t ret; diff --git a/cert_mgr_service/services/core/network/cert_network.c b/cert_mgr_service/services/core/network/cert_network.c index 6356773..9ad35ed 100644 --- a/cert_mgr_service/services/core/network/cert_network.c +++ b/cert_mgr_service/services/core/network/cert_network.c @@ -981,7 +981,7 @@ static void BuildUserOption(CoapOptList* list, List* optionList, int32_t startOp continue; } CERT_LOG_INFO("[BuildUserOption] option is valid."); - if (head->optType == COAP_OPT_URI_PATH) { + if ((int)head->optType == COAP_OPT_URI_PATH) { CERT_LOG_INFO("[BuildUserOption] option is uri path."); if (BuildUriOption((char*)(head->data), head->length, optionList) != CERT_OK) { CERT_LOG_ERROR("[BuildUserOption] Build uri path option failed, data = %s, type = %d", head->data, head->optType); @@ -1178,7 +1178,7 @@ int32_t DecodeLENTKL(const TLSSession* session, CoapPacket* coapPkt) return CERT_ERR; } if (messageLen == 13) { - extendedLength = ((size_t)messageExtendedLength[0] & 0xFF + 13); + extendedLength = (((size_t)messageExtendedLength[0] & 0xFF) + 13); } else if (messageLen == 14) { extendedLength = (((size_t)(messageExtendedLength[0] << 8 | messageExtendedLength[1])) + 269); } else if (messageLen == 15) { diff --git a/cert_mgr_service/services/core/network/cert_tls.c b/cert_mgr_service/services/core/network/cert_tls.c index 031e1f5..1360c9e 100644 --- a/cert_mgr_service/services/core/network/cert_tls.c +++ b/cert_mgr_service/services/core/network/cert_tls.c @@ -59,7 +59,7 @@ int32_t LoadCustomCert(mbedtls_x509_crt* chain) int32_t LoadCommonCert(mbedtls_x509_crt* chain, uint32_t cursor) { - if (chain == NULL || cursor >= ARRAY_SIZE(g_commonCerts) || cursor < 0) { + if (chain == NULL || cursor >= ARRAY_SIZE(g_commonCerts)) { CERT_LOG_ERROR("[LoadCustomCert] Invalid parameter"); return ERR_NET_PARSE_CERT_FAIL; } diff --git a/cert_mgr_service/services/core/utils/cert_utils_file.c b/cert_mgr_service/services/core/utils/cert_utils_file.c index 58767d6..9239c50 100644 --- a/cert_mgr_service/services/core/utils/cert_utils_file.c +++ b/cert_mgr_service/services/core/utils/cert_utils_file.c @@ -118,7 +118,7 @@ static int32_t L0WriteFile(const char* path, const char* data, uint32_t dataLen, } int ret = 0; - if (UtilsFileWrite(fd, data, dataLen) != dataLen) { + if (UtilsFileWrite(fd, data, dataLen) != (int32_t)dataLen) { CERT_LOG_ERROR("[L0WriteFile] : Write data failed\n"); ret = CERT_ERR; } diff --git a/cert_mgr_service/services/oem_adapter/src/cert_mgr_oem_file.c b/cert_mgr_service/services/oem_adapter/src/cert_mgr_oem_file.c index c409beb..c66ead6 100644 --- a/cert_mgr_service/services/oem_adapter/src/cert_mgr_oem_file.c +++ b/cert_mgr_service/services/oem_adapter/src/cert_mgr_oem_file.c @@ -160,7 +160,7 @@ static int32_t OEML0WriteFile(const char* path, const char* data, uint32_t dataL } int ret = 0; - if (UtilsFileWrite(fd,data,dataLen) != dataLen) { + if (UtilsFileWrite(fd,data,dataLen) != (int32_t)dataLen) { ret = CERT_MGR_OEM_ERR; } (void)UtilsFileClose(fd); -- Gitee