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

2019-10-22 Thread Michael Paquier
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,

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

2019-10-22 Thread Michael Paquier
On Tue, Oct 22, 2019 at 10:05:45AM +0200, Peter Eisentraut wrote: > You probably want something like > > if (end && *end != ...) 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 remo

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

2019-10-22 Thread Peter Eisentraut
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

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

2019-10-20 Thread Michael Paquier
Fix parsing of integer values for connection parameters in libpq Commit e7a2217 has introduced stricter checks for integer values in connection parameters for libpq. However this failed to correctly check after trailing whitespaces, while leading whitespaces were discarded per the use of strtol(3

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

2019-10-20 Thread Michael Paquier
Fix parsing of integer values for connection parameters in libpq Commit e7a2217 has introduced stricter checks for integer values in connection parameters for libpq. However this failed to correctly check after trailing whitespaces, while leading whitespaces were discarded per the use of strtol(3