Content-Length: 1124 | pFad | http://github.com/postgrespro/pg_wait_sampling/pull/100.diff

thub.com diff --git a/pg_wait_sampling.c b/pg_wait_sampling.c index f5bd6e0..e165a6a 100644 --- a/pg_wait_sampling.c +++ b/pg_wait_sampling.c @@ -649,6 +649,10 @@ receive_array(SHMRequest request, Size item_size, Size *count) pgws_collector_hdr->request = request; LockRelease(&collectorTag, ExclusiveLock, false); + /* + * Check that the collector was started to avoid NULL + * pointer dereference. + */ if (!pgws_collector_hdr->latch) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("pg_wait_sampling collector wasn't started"))); @@ -819,6 +823,14 @@ pg_wait_sampling_reset_profile(PG_FUNCTION_ARGS) pgws_collector_hdr->request = PROFILE_RESET; LockRelease(&collectorTag, ExclusiveLock, false); + /* + * Check that the collector was started to avoid NULL + * pointer dereference. + */ + if (!pgws_collector_hdr->latch) + ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), + errmsg("pg_wait_sampling collector wasn't started"))); + SetLatch(pgws_collector_hdr->latch); LockRelease(&queueTag, ExclusiveLock, false);








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/pg_wait_sampling/pull/100.diff

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy