pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pgcrypto: Fix check for buffer size
Date: Tue, 30 Jan 2024 10:28:01 +0000
Message-ID: <E1rUlLV-003pPD-F6@gemulon.postgresql.org> (raw)

pgcrypto: Fix check for buffer size

The code copying the PGP block into the temp buffer failed to
account for the extra 2 bytes in the buffer which are needed
for the prefix. If the block was oversized, subsequent checks
of the prefix would have exceeded the buffer size.  Since the
block sizes are hardcoded in the list of supported ciphers it
can be verified that there is no live bug here. Backpatch all
the way for consistency though, as this bug is old.

Author: Mikhail Gribkov <youzhick@gmail.com>
Discussion: https://postgr.es/m/CAMEv5_uWvcMCMdRFDsJLz2Q8g16HEa9xWyfrkr+FYMMFJhawOw@mail.gmail.com
Backpatch-through: v12

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/54717fcaad759312b2ff8588e146977f529e7798

Modified Files
--------------
contrib/pgcrypto/pgp-decrypt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1rUlLV-003pPD-F6@gemulon.postgresql.org>
Permalink:  ../E1rUlLV-003pPD-F6@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rUlLV-003pPD-F6@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: dgustafsson@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: pgcrypto: Fix check for buffer size
  In-Reply-To: <E1rUlLV-003pPD-F6@gemulon.postgresql.org>

* 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