Re: Fix overflow in pg_size_pretty
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Joseph Koshakow <koshy44@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-07-27T22:28:23Z
Lists: pgsql-hackers
Attachments
- pg_size_pretty_bigint_fix.patch (application/octet-stream) patch
On Sun, 28 Jul 2024 at 07:18, Joseph Koshakow <koshy44@gmail.com> wrote: > Attached is a patch that resolves an overflow in pg_size_pretty() that > resulted in unexpected behavior when PG_INT64_MIN was passed in as an > argument. Could we just fix this more simply by assigning the absolute value of the signed variable into an unsigned type? It's a bit less code and gets rid of the explicit test for PG_INT64_MIN. David
Commits
-
Fix incorrect return value for pg_size_pretty(bigint)
- 0a80e88d902d 15.8 landed
- 6f6b0f193db4 16.4 landed
- 1e020258e53c 17.0 landed
- b181062aa572 18.0 landed