We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent267c6ce commit1a8558cCopy full SHA for 1a8558c
pg_query_state.c
@@ -494,7 +494,7 @@ pg_query_state(PG_FUNCTION_ARGS)
494
errmsg("attempt to extract state of current process")));
495
496
proc=BackendPidGetProc(pid);
497
-if (!proc||proc->backendId==InvalidBackendId)
+if (!proc||proc->backendId==InvalidBackendId||proc->databaseId==InvalidOid||proc->roleId==InvalidOid)
498
ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
499
errmsg("backend with pid=%d not found",pid)));
500
@@ -885,7 +885,7 @@ GetRemoteBackendWorkers(PGPROC *proc)
885
886
mqh=shm_mq_attach(mq,NULL,NULL);
887
mq_receive_result=shm_mq_receive(mqh,&msg_len, (void**)&msg, false);
888
-if (mq_receive_result!=SHM_MQ_SUCCESS)
+if (mq_receive_result!=SHM_MQ_SUCCESS||msg==NULL||msg_len!=sizeof(int)+msg->number*sizeof(pid_t))
889
gotomq_error;
890
891
for (i=0;i<msg->number;i++)