Re: pgsql: Fix parsing of integer values for connection parameters in libpq

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Fix parsing of integer values for connection parameters in libpq
Date: 2019-10-23 02:37:05
Message-ID: 20191023023652.GB3286@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Tue, Oct 22, 2019 at 07:05:53PM +0900, Michael Paquier wrote:
> Yes, it looks like a brain fade here. Conversion failures are tracked
> before that, so strtol() would not return NULL for endptr. The first
> part could just be removed as per the attached.

I looked at that with a fresher mind, and fixed it, with an extra
assertion making sure that we never call it with a NULL input. All
callers of parse_int_param are careful to not call the routine with a
NULL input, but future callers may not be that careful...
--
Michael

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2019-10-23 03:28:01 pgsql: Remove last traces of --adduser/--no-adduser in createuser
Previous Message Michael Paquier 2019-10-23 02:35:54 pgsql: Fix thinkos from 4f4061b for libpq integer parsing