Re: Fix a host of strto*() bugs

From: "Tristan Partin" <tristan(at)partin(dot)io>
To: "Michael Paquier" <michael(at)paquier(dot)xyz>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>, <malis(at)pgrust(dot)com>
Subject: Re: Fix a host of strto*() bugs
Date: 2026-08-03 20:32:38
Message-ID: DKFLF9YQH0J9.3N2DRXCO8U5KO@partin.io
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun Aug 2, 2026 at 10:26 AM UTC, Michael Paquier wrote:
> On Fri, Jul 31, 2026 at 05:03:38PM +0900, Michael Paquier wrote:
>> @@ -961,7 +961,7 @@ precheck_tar_backup_file(verifier_context *context, char *relpath,
>> * Report an error if we didn't consume at least one character, if the
>> * result is 0, or if the value is too large to be a valid OID.
>> */
>> - if (suffix == NULL || num <= 0 || num > OID_MAX)
>> + if (suffix == relpath || num <= 0 || num > OID_MAX)
>>
>> Because that's something part of the C standard. My Linux man page
>> has a reference to that, as well:
>> "If there were no digits at all, strtoul() stores the original value
>> of nptr in *endptr (and returns 0)."
>
> 0002 and 0005 have been merged together, and applied as 355814931141.

Here are some re-spins of the previous uncommitted patches. They have
been rebased on master. I am really curious how the formatting got
messed up initially. Thanks for committing the the two patches.

--
Tristan Partin
PostgreSQL Contributors Team
AWS (https://aws.amazon.com)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2026-08-03 20:36:17 Re: WAL compression setting after PostgreSQL LZ4 default change
Previous Message Matthias van de Meent 2026-08-03 20:07:06 Re: Resetting snapshots during the first phase of [CREATE |RE]INDEX CONCURRENTLY