Skip to content

Commit 2a5f6c1

Browse files
committed
Fix resp_calls array size
This got broken during a refactoring in de71282. We need the plus 2 items because of the overflow/underflow bucket, without that we can possibly overindex this array and corrupt other counters. In earlier versions we even had the encoding variable stored directly after this array, which possibly caused crashes or incorrectly working string functions.
1 parent 5526e41 commit 2a5f6c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pg_stat_monitor.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,9 @@ typedef struct Counters
325325
JitInfo jitinfo;
326326
ErrorInfo error;
327327
Wal_Usage walusage;
328-
int resp_calls[MAX_RESPONSE_BUCKET]; /* execution time's in
329-
* msec */
328+
int resp_calls[MAX_RESPONSE_BUCKET + 2]; /* execution time's in
329+
* msec; including 2
330+
* outlier buckets */
330331
int64 parallel_workers_to_launch; /* # of parallel workers planned
331332
* to be launched */
332333
int64 parallel_workers_launched; /* # of parallel workers actually

0 commit comments

Comments
 (0)