pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: pgsql-hackers@lists.postgresql.org, Fujii Masao <fujii@postgresql.org>
Subject: Re: Remove line length restriction in passwordFromFile()
Date: Tue, 01 Sep 2020 11:14:47 -0400
Message-ID: <54742.1598973287@sss.pgh.pa.us> (raw)
In-Reply-To: <b2391bb7-33c5-a25e-e99a-81f7e96efdad@oss.nttdata.com>
References: <4187382.1598909041@sss.pgh.pa.us>
	<90aed8c6-a171-4cf7-4e4a-0d4d9593f6c5@oss.nttdata.com>
	<b2391bb7-33c5-a25e-e99a-81f7e96efdad@oss.nttdata.com>

Fujii Masao <masao.fujii@oss.nttdata.com> writes:
> The patch looks good to me, except the following minor thing.
> +		if (fgets(buf.data + buf.len, buf.maxlen - buf.len - 1, fp) == NULL)
> IIUC fgets() reads the data with the specified size - 1, so ISTM that -1 of
> "buf.maxlen - buf.len - 1" is not necessary.

Good point, I was being unduly conservative.  Thanks for reviewing
the patch!

			regards, tom lane





view thread (3+ messages)

Message-ID: <54742.1598973287@sss.pgh.pa.us>
Permalink:  ../54742.1598973287@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/54742.1598973287@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, masao.fujii@oss.nttdata.com, fujii@postgresql.org
  Subject: Re: Remove line length restriction in passwordFromFile()
  In-Reply-To: <54742.1598973287@sss.pgh.pa.us>

* 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