!597 【SQL时间预测】敏感信息释放前置零

Merge pull request !597 from 宋清怡/master
This commit is contained in:
opengauss-bot
2021-01-11 15:35:09 +08:00
committed by Gitee

View File

@ -272,6 +272,14 @@ static GS_UCHAR* DecodeClientKey(StringInfo cahome)
return plainpwd; return plainpwd;
} }
static inline void CleanCertInfo(StringInfo str)
{
errno_t rc = memset_s(str->data, str->len, 0, str->len);
securec_check(rc, "\0", "\0");
pfree_ext(str->data);
pfree_ext(str);
}
static void GetCurlClientCerts(AiConn* connHandle) static void GetCurlClientCerts(AiConn* connHandle)
{ {
char* gausshome = getGaussHome(); char* gausshome = getGaussHome();
@ -300,12 +308,11 @@ static void GetCurlClientCerts(AiConn* connHandle)
errmsg("Read certificate files failed."))); errmsg("Read certificate files failed.")));
} }
pfree_ext(caPath->data); CleanCertInfo(caPath);
pfree_ext(certPath->data); CleanCertInfo(certPath);
pfree_ext(keyPath->data); CleanCertInfo(keyPath);
pfree_ext(caPath); errno_t rc = memset_s(plainpwd, CIPHER_LEN + 1, 0, CIPHER_LEN + 1);
pfree_ext(certPath); securec_check(rc, "\0", "\0");
pfree_ext(keyPath);
pfree_ext(plainpwd); pfree_ext(plainpwd);
} }