From a61f0533cf19d6c23b617e2e6967a114e39a9b1e Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Thu, 18 May 2023 18:00:15 +0800 Subject: [PATCH] fix: invalid read issue --- source/common/src/tmsg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 91d53884b8..a975f92569 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -1566,21 +1566,21 @@ int32_t tDeserializeSGetUserAuthRspImpl(SDecoder *pDecoder, SGetUserAuthRsp *pRs char db[TSDB_DB_FNAME_LEN] = {0}; if (tDecodeCStrTo(pDecoder, db) < 0) return -1; int32_t len = strlen(db); - taosHashPut(pRsp->createdDbs, db, len, db, len); + taosHashPut(pRsp->createdDbs, db, len, db, len + 1); } for (int32_t i = 0; i < numOfReadDbs; ++i) { char db[TSDB_DB_FNAME_LEN] = {0}; if (tDecodeCStrTo(pDecoder, db) < 0) return -1; int32_t len = strlen(db); - taosHashPut(pRsp->readDbs, db, len, db, len); + taosHashPut(pRsp->readDbs, db, len, db, len + 1); } for (int32_t i = 0; i < numOfWriteDbs; ++i) { char db[TSDB_DB_FNAME_LEN] = {0}; if (tDecodeCStrTo(pDecoder, db) < 0) return -1; int32_t len = strlen(db); - taosHashPut(pRsp->writeDbs, db, len, db, len); + taosHashPut(pRsp->writeDbs, db, len, db, len + 1); } if (!tDecodeIsEnd(pDecoder)) {