Re: pg_dump: Fix dangling pointer in EndCompressorZstd()

2025-04-17 Thread Daniel Gustafsson
> On 17 Apr 2025, at 01:12, Tom Lane wrote: > > Michael Paquier writes: >> On Wed, Apr 16, 2025 at 04:19:02PM +0200, Daniel Gustafsson wrote: >>> Agreed, while it's perfectly safe today the end method should not make >>> assumptions about the use of the private_data pointer upon return and shoul

Re: pg_dump: Fix dangling pointer in EndCompressorZstd()

2025-04-16 Thread Tom Lane
Michael Paquier writes: > On Wed, Apr 16, 2025 at 04:19:02PM +0200, Daniel Gustafsson wrote: >> Agreed, while it's perfectly safe today the end method should not make >> assumptions about the use of the private_data pointer upon return and should >> leave it set to NULL. > Indeed. I was just loo

Re: pg_dump: Fix dangling pointer in EndCompressorZstd()

2025-04-16 Thread Michael Paquier
On Wed, Apr 16, 2025 at 04:19:02PM +0200, Daniel Gustafsson wrote: > Agreed, while it's perfectly safe today the end method should not make > assumptions about the use of the private_data pointer upon return and should > leave it set to NULL. Indeed. I was just looking at applying what Alexander

Re: pg_dump: Fix dangling pointer in EndCompressorZstd()

2025-04-16 Thread Daniel Gustafsson
> On 16 Apr 2025, at 13:48, Ashutosh Bapat wrote: > > On Wed, Apr 16, 2025 at 1:57 PM Alexander Kuznetsov > wrote: >> >> Hello everyone, >> >> We've found that EndCompressorZstd() doesn't set cs->private_data to NULL >> after pg_free(), >> unlike other EndCompressor implementations. >> While

Re: pg_dump: Fix dangling pointer in EndCompressorZstd()

2025-04-16 Thread Ashutosh Bapat
On Wed, Apr 16, 2025 at 1:57 PM Alexander Kuznetsov wrote: > > Hello everyone, > > We've found that EndCompressorZstd() doesn't set cs->private_data to NULL > after pg_free(), > unlike other EndCompressor implementations. > While this doesn't currently cause issues (as the pointer soon gets > re