pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix parsing of integer values for connection parameters in libpq
Date: Wed, 23 Oct 2019 11:37:05 +0900
Message-ID: <20191023023652.GB3286@paquier.xyz> (raw)
In-Reply-To: <20191022100553.GA3908@paquier.xyz>
References: <E1iMNH3-0008Tp-T0@gemulon.postgresql.org>
	<ec64956b-4597-56b6-c3db-457d15250fe4@2ndquadrant.com>
	<20191022100553.GA3908@paquier.xyz>

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (5+ messages)

Message-ID: <20191023023652.GB3286@paquier.xyz>
Permalink:  ../20191023023652.GB3286@paquier.xyz/
Also on:    postgresql.org/message-id/20191023023652.GB3286@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, peter.eisentraut@2ndquadrant.com
  Subject: Re: pgsql: Fix parsing of integer values for connection parameters in libpq
  In-Reply-To: <20191023023652.GB3286@paquier.xyz>
  References: <E1iMNH3-0008Tp-T0@gemulon.postgresql.org> <ec64956b-4597-56b6-c3db-457d15250fe4@2ndquadrant.com> <20191022100553.GA3908@paquier.xyz> <20191023023652.GB3286@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox