Re: pg_stat_get_activity(): integer overflow due to (int) * (int) for MemoryContextAllocHuge()
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Jakub Wartak <jakub.wartak@enterprisedb.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Robert Haas <robertmhaas@gmail.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Date: 2023-09-27T08:08:23Z
Lists: pgsql-hackers
On Wed, Sep 27, 2023 at 08:41:55AM +0200, Jakub Wartak wrote: > Attached patch adjusts pgstat_track_activity_query_size to be of > size_t from int and fixes the issue. This cannot be backpatched, and using size_t is not really needed as track_activity_query_size is capped at 1MB. Why don't you just tweak the calculation done in pgstat_read_current_status() instead, say with a cast? -- Michael
Commits
-
Avoid memory size overflow when allocating backend activity buffer
- 9b3900cdb734 12.17 landed
- a0b013625908 13.13 landed
- f91c87b31463 14.10 landed
- 95e91da66cf5 15.5 landed
- 75f31a3f2674 16.1 landed
- a956bd3fa9d9 17.0 landed