Re: Fix error handling in be_tls_open_server()

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Sergey Shinderuk <s(dot)shinderuk(at)postgrespro(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix error handling in be_tls_open_server()
Date: 2023-08-23 13:23:20
Message-ID: E3921399-FAE7-4B1F-B1BF-B3357DDC9F19@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 1 Aug 2023, at 16:44, Sergey Shinderuk <s(dot)shinderuk(at)postgrespro(dot)ru> wrote:

> A static analyzer reported a possible pfree(NULL) in be_tls_open_server().

This has the smell of a theoretical problem, I can't really imagine a
certificate where which would produce this. Have you been able to trigger it?

Wouldn't a better fix be to error out on len == -1 as in the attached, maybe
with a "Shouldn't happen" comment?

--
Daniel Gustafsson

Attachment Content-Type Size
X509_NAME_get_text_by_NID.diff application/octet-stream 1.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2023-08-23 14:02:44 Re: Schema variables - new implementation for Postgres 15
Previous Message David Rowley 2023-08-23 12:52:52 meson uses stale pg_config_paths.h left over from make