diff --git a/source/dnode/mnode/impl/test/profile/profile.cpp b/source/dnode/mnode/impl/test/profile/profile.cpp index 2ae113e0514bdec8c5c7c038ee2cbb9497bf2dec..6ab6d364cb6f326e37521815b7b5cf0b8fdc82ef 100644 --- a/source/dnode/mnode/impl/test/profile/profile.cpp +++ b/source/dnode/mnode/impl/test/profile/profile.cpp @@ -32,13 +32,14 @@ TEST_F(MndTestProfile, 01_ConnectMsg) { connectReq.pid = 1234; char passwd[] = "taosdata"; - char secretEncrypt[TSDB_PASSWORD_LEN] = {0}; + char secretEncrypt[TSDB_PASSWORD_LEN + 1] = {0}; taosEncryptPass_c((uint8_t*)passwd, strlen(passwd), secretEncrypt); strcpy(connectReq.app, "mnode_test_profile"); strcpy(connectReq.db, ""); strcpy(connectReq.user, "root"); strcpy(connectReq.passwd, secretEncrypt); + strcpy(connectReq.sVer, version); int32_t contLen = tSerializeSConnectReq(NULL, 0, &connectReq); void* pReq = rpcMallocCont(contLen); @@ -66,7 +67,7 @@ TEST_F(MndTestProfile, 01_ConnectMsg) { TEST_F(MndTestProfile, 02_ConnectMsg_InvalidDB) { char passwd[] = "taosdata"; - char secretEncrypt[TSDB_PASSWORD_LEN] = {0}; + char secretEncrypt[TSDB_PASSWORD_LEN + 1] = {0}; taosEncryptPass_c((uint8_t*)passwd, strlen(passwd), secretEncrypt); SConnectReq connectReq = {0}; @@ -75,6 +76,7 @@ TEST_F(MndTestProfile, 02_ConnectMsg_InvalidDB) { strcpy(connectReq.db, "invalid_db"); strcpy(connectReq.user, "root"); strcpy(connectReq.passwd, secretEncrypt); + strcpy(connectReq.sVer, version); int32_t contLen = tSerializeSConnectReq(NULL, 0, &connectReq); void* pReq = rpcMallocCont(contLen); diff --git a/source/dnode/mnode/impl/test/show/show.cpp b/source/dnode/mnode/impl/test/show/show.cpp index 0ccefa7ca2c265afe299a55b218d46be291c463e..2e67ffa946d68edb8e7f73ef2082ea7a3c8fc734 100644 --- a/source/dnode/mnode/impl/test/show/show.cpp +++ b/source/dnode/mnode/impl/test/show/show.cpp @@ -55,7 +55,7 @@ TEST_F(MndTestShow, 02_ShowMsg_InvalidMsgStart) { TEST_F(MndTestShow, 03_ShowMsg_Conn) { char passwd[] = "taosdata"; - char secretEncrypt[TSDB_PASSWORD_LEN] = {0}; + char secretEncrypt[TSDB_PASSWORD_LEN + 1] = {0}; taosEncryptPass_c((uint8_t*)passwd, strlen(passwd), secretEncrypt); SConnectReq connectReq = {0}; @@ -64,6 +64,7 @@ TEST_F(MndTestShow, 03_ShowMsg_Conn) { strcpy(connectReq.db, ""); strcpy(connectReq.user, "root"); strcpy(connectReq.passwd, secretEncrypt); + strcpy(connectReq.sVer, version); int32_t contLen = tSerializeSConnectReq(NULL, 0, &connectReq); void* pReq = rpcMallocCont(contLen);