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

On 2019-10-21 04:18, Michael Paquier wrote:
> Fix parsing of integer values for connection parameters in libpq

Something in this code doesn't make sense:

+   /*
+    * Skip any trailing whitespace; if anything but whitespace remains
before
+    * the terminating character, fail
+    */
+   while (*end && *end != '\0' && isspace((unsigned char) *end))
+       end++;
+
+   if (*end && *end != '\0')
+       goto error;

You probably want something like

    if (end && *end != ...)

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (5+ messages)  latest in thread

Message-ID: <ec64956b-4597-56b6-c3db-457d15250fe4@2ndquadrant.com>
Permalink:  ../ec64956b-4597-56b6-c3db-457d15250fe4@2ndquadrant.com/
Also on:    postgresql.org/message-id/ec64956b-4597-56b6-c3db-457d15250fe4@2ndquadrant.com

 · 

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

* 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