pgsql: Add missing error check in pgcrypto/crypt-md5.c.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add missing error check in pgcrypto/crypt-md5.c.
Date: 2020-10-16 16:00:14
Message-ID: E1kTS9O-0002Nf-Rb@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add missing error check in pgcrypto/crypt-md5.c.

In theory, the second px_find_digest call in px_crypt_md5 could fail
even though the first one succeeded, since resource allocation is
required. Don't skip testing for a failure. (If one did happen,
the likely result would be a crash rather than clean recovery from
an OOM failure.)

The code's been like this all along, so back-patch to all supported
branches.

Daniel Gustafsson

Discussion: https://postgr.es/m/AA8D6FE9-4AB2-41B4-98CB-AE64BA668C03@yesql.se

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9c3032881e00eb92a6bb4fad966831881e9c3b41

Modified Files
--------------
contrib/pgcrypto/crypt-md5.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-10-17 01:54:55 pgsql: Update time zone data files to tzdata release 2020c.
Previous Message Tom Lane 2020-10-16 15:36:59 pgsql: Doc: tweak column widths in synchronous-commit-matrix table.