OCT 1. 修正代码静态扫描问题

This commit is contained in:
huangxin 2022-12-06 14:58:42 +08:00
parent 5b1822198f
commit 1057061b7b
6 changed files with 12 additions and 11 deletions

View File

@ -108,8 +108,8 @@ unsigned char *base64_decode(const char *pBase64, unsigned int *pOutSize) {
#else #else
EVP_ENCODE_CTX *pCtx = EVP_ENCODE_CTX_new(); EVP_ENCODE_CTX *pCtx = EVP_ENCODE_CTX_new();
#endif #endif
int enSize = 0; int enSize = 0;
int size = 0; int size;
unsigned char *pDecode = NULL; unsigned char *pDecode = NULL;
if (pBase64 == NULL || strlen(pBase64) == 0) { if (pBase64 == NULL || strlen(pBase64) == 0) {

View File

@ -123,7 +123,7 @@ int symmetric_decrypto(AES_TYPE algorithmType,
unsigned char iv[EVP_MAX_IV_LENGTH] = {0}; unsigned char iv[EVP_MAX_IV_LENGTH] = {0};
const EVP_CIPHER *pCipher; const EVP_CIPHER *pCipher;
if (!pInBuf || !pOutSize || !pKey || inSize < 0) { if (!pInBuf || !pOutSize || !pKey || inSize == 0) {
return -ERR_INPUT_PARAMS; return -ERR_INPUT_PARAMS;
} }
@ -197,7 +197,7 @@ int symmetric_encrypto(AES_TYPE algorithmType,
unsigned char iv[EVP_MAX_IV_LENGTH] = {0}; unsigned char iv[EVP_MAX_IV_LENGTH] = {0};
const EVP_CIPHER *pCipher; const EVP_CIPHER *pCipher;
if (!pInBuf || !pOutSize || !pKey || inSize < 0) { if (!pInBuf || !pOutSize || !pKey || inSize == 0) {
return -ERR_INPUT_PARAMS; return -ERR_INPUT_PARAMS;
} }

View File

@ -2,7 +2,6 @@
// Created by xajhu on 2021/7/6 0006. // Created by xajhu on 2021/7/6 0006.
// //
#include <string.h> #include <string.h>
#include <stdlib.h>
#include <uv.h> #include <uv.h>
#include "s2j/s2j.h" #include "s2j/s2j.h"

View File

@ -7,7 +7,6 @@
#include <sds/sds.h> #include <sds/sds.h>
#include "hardware.h" #include "hardware.h"
#include "task_manager.h"
#include "user_errno.h" #include "user_errno.h"
#include "uthash/uthash.h" #include "uthash/uthash.h"
#include "misc.h" #include "misc.h"

View File

@ -9,12 +9,15 @@
#include "msg_queue.h" #include "msg_queue.h"
#include "config.h" #include "config.h"
#include "misc.h"
#include "s2j/s2j.h" #include "s2j/s2j.h"
#include "pppoe_info.h"
#include "user_errno.h" #include "user_errno.h"
#ifdef LWIP_ON
#include "misc.h"
#include "pppoe_info.h"
#include "user_info.h" #include "user_info.h"
#include "vxlan_pkg.h" #include "vxlan_pkg.h"
#endif
#define AGENT_CMD_ADDUSER ("add-ywg-pppoe-vcpe") #define AGENT_CMD_ADDUSER ("add-ywg-pppoe-vcpe")
#define AGENT_CMD_REMOVUSER ("remove-ywg-pppoe-vcpe") #define AGENT_CMD_REMOVUSER ("remove-ywg-pppoe-vcpe")
@ -309,7 +312,7 @@ static void process_data_msg(void *UNUSED(pDataCh), zmq_msg_t *pMsg) {
dzlog_debug("Process: %s\n", pMqMsg->params); dzlog_debug("Process: %s\n", pMqMsg->params);
decode_add_user_msg(pMqMsg->params, &p); decode_add_user_msg(pMqMsg->params, &p);
if (p) { if (p) {
#if LWIP_ON #ifdef LWIP_ON
int m, n; int m, n;
for (m = 0; m < p->infoCount; m++) { for (m = 0; m < p->infoCount; m++) {
PADD_INFO pInfo = &(p->pInfo[m]); PADD_INFO pInfo = &(p->pInfo[m]);
@ -340,7 +343,7 @@ static void process_data_msg(void *UNUSED(pDataCh), zmq_msg_t *pMsg) {
decode_remove_user_msg(pMqMsg->params, &p); decode_remove_user_msg(pMqMsg->params, &p);
if (p) { if (p) {
#if LWIP_ON #ifdef LWIP_ON
int m; int m;
for (m = 0; m < p->nCount; m++) { for (m = 0; m < p->nCount; m++) {
user_info_remove(p->pUsers[m]); user_info_remove(p->pUsers[m]);

View File

@ -24,7 +24,7 @@ typedef struct {
const char *proto_decode_context(const char *pString, unsigned int *pVer, unsigned long long *pTm) { const char *proto_decode_context(const char *pString, unsigned int *pVer, unsigned long long *pTm) {
cJSON *pMsgCtx; cJSON *pMsgCtx;
unsigned char *pBase64; unsigned char *pBase64;
int decodeSize, ret; int decodeSize;
unsigned int outSize = 0; unsigned int outSize = 0;
char *pMsgContent = NULL; char *pMsgContent = NULL;
cJSON *pRoot = cJSON_Parse(pString); cJSON *pRoot = cJSON_Parse(pString);