Re: Fix uninitialized copy_data var (src/backend/commands/subscriptioncmds.c)

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix uninitialized copy_data var (src/backend/commands/subscriptioncmds.c)
Date: 2021-06-28 03:29:06
Message-ID: YNlCAhkb3FVmE0ld@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 28, 2021 at 10:17:55AM +1000, Peter Smith wrote:
> IIUC for the case ALTER_SUBSCRIPTION_DROP_PUBLICATION it looks like
> the uninitialized copy_data local stack var would remain uninitialized
> (undefined) still at the time it is passed at
> AlterSubscription_refresh(sub, copy_data);

Yes, that's wrong. AlterSubscription_refresh() would happily look at
this uninitialized value when performing a refresh with this command.
That's the only code path using parse_subscription_options() with this
pattern. Applied on HEAD.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-06-28 03:51:11 Re: fdatasync performance problem with large number of DB files
Previous Message Tatsuro Yamada 2021-06-28 02:53:26 Re: Farewell greeting