fix: init buf to avoid invalid write
This commit is contained in:
parent
f51e1b8405
commit
890075ef4a
|
@ -1463,7 +1463,7 @@ static char* formatTimestamp(char* buf, int64_t val, int precision) {
|
|||
}
|
||||
|
||||
void blockDebugShowData(const SArray* dataBlocks) {
|
||||
char pBuf[128];
|
||||
char pBuf[128] = {0};
|
||||
int32_t sz = taosArrayGetSize(dataBlocks);
|
||||
for (int32_t i = 0; i < sz; i++) {
|
||||
SSDataBlock* pDataBlock = taosArrayGet(dataBlocks, i);
|
||||
|
|
|
@ -783,7 +783,7 @@ int64_t taosTimeTruncate(int64_t t, const SInterval* pInterval, int32_t precisio
|
|||
// 2020-07-03 17:48:42
|
||||
// and the parameter can also be a variable.
|
||||
const char* fmtts(int64_t ts) {
|
||||
static char buf[96];
|
||||
static char buf[96] = {0};
|
||||
size_t pos = 0;
|
||||
struct tm tm;
|
||||
|
||||
|
|
|
@ -369,8 +369,8 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) {
|
|||
mError("failed to process sync msg:%p type:%s since %s", pMsg, TMSG_INFO(pMsg->msgType), terrstr());
|
||||
return TAOS_SYNC_PROPOSE_OTHER_ERROR;
|
||||
}
|
||||
|
||||
char logBuf[512];
|
||||
|
||||
char logBuf[512] = {0};
|
||||
char *syncNodeStr = sync2SimpleStr(pMgmt->sync);
|
||||
snprintf(logBuf, sizeof(logBuf), "==vnodeProcessSyncReq== msgType:%d, syncNode: %s", pMsg->msgType, syncNodeStr);
|
||||
syncRpcMsgLog2(logBuf, pMsg);
|
||||
|
|
|
@ -815,7 +815,7 @@ int32_t syncNodeSendMsgByInfo(const SNodeInfo* nodeInfo, SSyncNode* pSyncNode, S
|
|||
}
|
||||
|
||||
cJSON* syncNode2Json(const SSyncNode* pSyncNode) {
|
||||
char u64buf[128];
|
||||
char u64buf[128] = {0};
|
||||
cJSON* pRoot = cJSON_CreateObject();
|
||||
|
||||
if (pSyncNode != NULL) {
|
||||
|
|
|
@ -215,7 +215,7 @@ SyncTimeout* syncTimeoutFromRpcMsg2(const SRpcMsg* pRpcMsg) {
|
|||
}
|
||||
|
||||
cJSON* syncTimeout2Json(const SyncTimeout* pMsg) {
|
||||
char u64buf[128];
|
||||
char u64buf[128] = {0};
|
||||
cJSON* pRoot = cJSON_CreateObject();
|
||||
|
||||
if (pMsg != NULL) {
|
||||
|
|
Loading…
Reference in New Issue