[PATCH] Fix segfault calling PQflush on invalid connection

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: [PATCH] Fix segfault calling PQflush on invalid connection
Date: 2022-08-15 00:44:55
Message-ID: CA+mi_8Zm_mVVyW1iNFgyMd9Oh0Nv8-F+7Y3-BqwMgTMHuo_h2Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PQflush calls pqFlush, which performs struct access to the connection
without checking if it's valid, resulting in a segfault if called with
a null pointer.

Please find attached a patch adding a guard to PQflush().

Cheers

-- Daniele

Attachment Content-Type Size
0001-Fix-segfault-calling-PQflush-on-invalid-connection.patch text/x-patch 672 bytes

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2022-08-15 01:44:07 Re: [PATCH] Fix segfault calling PQflush on invalid connection
Previous Message Anton A. Melnikov 2022-08-14 19:47:57 [BUG] Crash of logical replica with trigger.