Some incorrect option sizes for PQconninfoOption in libpq

Started by Michael Paquierabout 6 years ago3 messageshackers
Jump to latest
#1Michael Paquier
michael@paquier.xyz

Hi all,

I was reviewing the libpq code for the recent SSL protocol patch, and
noticed two mistakes with dispsize for the following parameters:
- channel_binding should be at 8, the largest value being "require".
- gssencmode should be at 8.

In those cases the zero-terminator was forgotten in the count. A
similar mistake was done in the past for sslmode that was fixed by
f4051e36. It is unlikely that dispsize is being used, but we cannot
break that on compatibility grounds, and the current numbers are
incorrect so let's fix it.

Thoughts?
--
Michael

Attachments:

libpq-connect-dispsize.patchtext/x-diff; charset=us-asciiDownload+3-3
#2Daniel Gustafsson
daniel@yesql.se
In reply to: Michael Paquier (#1)
Re: Some incorrect option sizes for PQconninfoOption in libpq

On 28 Jan 2020, at 06:36, Michael Paquier <michael@paquier.xyz> wrote:

I was reviewing the libpq code for the recent SSL protocol patch, and
noticed two mistakes with dispsize for the following parameters:
- channel_binding should be at 8, the largest value being "require".
- gssencmode should be at 8.

In those cases the zero-terminator was forgotten in the count. A
similar mistake was done in the past for sslmode that was fixed by
f4051e36. It is unlikely that dispsize is being used, but we cannot
break that on compatibility grounds, and the current numbers are
incorrect so let's fix it.

Thoughts?

Nice catch! +1 on the attached patch.

cheers ./daniel

#3Michael Paquier
michael@paquier.xyz
In reply to: Daniel Gustafsson (#2)
Re: Some incorrect option sizes for PQconninfoOption in libpq

On Tue, Jan 28, 2020 at 11:57:19AM +0100, Daniel Gustafsson wrote:

Nice catch! +1 on the attached patch.

Thanks, fixed and backpatched down to 12, where gssencmode has been
added.
--
Michael