fix security issue

Offering: openGaussDev

More detail: fix try-catch of check_engine_status

Match-id-9560a5be8caa621a4d5bf1eb6e24403e5a2aacfa
This commit is contained in:
openGaussDev 2022-03-07 19:38:13 +08:00 committed by yanghao
parent 3900f93081
commit 38b7213f8e
1 changed files with 7 additions and 1 deletions

View File

@ -409,6 +409,7 @@ bool TryConnectRemoteServer(AiEngineConnInfo* conninfo, char** buf)
if (!CheckConnParams(conninfo)) {
return false;
}
bool exceptionCaught = false;
PG_TRY();
{
@ -444,14 +445,19 @@ bool TryConnectRemoteServer(AiEngineConnInfo* conninfo, char** buf)
}
PG_CATCH();
{
exceptionCaught = true;
t_thrd.int_cxt.ImmediateInterruptOK = immediateInterruptOKOld;
DestoryAiHandle(connHandle);
if (buf != NULL) {
*buf = NULL;
}
return false;
FlushErrorState();
}
PG_END_TRY();
if (exceptionCaught) {
return false;
}
if (buf != NULL) {
*buf = pstrdup(connHandle->rec_buf);
}