Re: pgsql: Exclude unlogged tables from base backups - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Exclude unlogged tables from base backups
Date
Msg-id 3587.1522005723@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Exclude unlogged tables from base backups  (David Steele <david@pgmasters.net>)
Responses Re: pgsql: Exclude unlogged tables from base backups  (David Steele <david@pgmasters.net>)
List pgsql-committers
David Steele <david@pgmasters.net> writes:
> On 3/25/18 2:16 PM, Tom Lane wrote:
>> Buildfarm member skink (valgrind) has reported this during its last couple
>> of runs:

> I think skink is using large values for rel oids and that has exposed a
> bug.  The strncpy doesn't zero terminate the string if the oid has the
> max number of characters.  At least, I was able to reproduce under those
> circumstances.

Actually, that code didn't guarantee zero termination under *any*
circumstances; it only happened to work if the stack contained
zeroes to start with.

> The attached should fix it.

Found this in my inbox right after pushing a fix.  I did it slightly
differently, emulating the later rather than earlier calls in reinit.c.
The earlier ones memset the whole target field because they're concerned
about being able to hash it, but we don't need that here, just zero
termination.

            regards, tom lane


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Exclude unlogged tables from base backups
Next
From: David Steele
Date:
Subject: Re: pgsql: Exclude unlogged tables from base backups