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

Tom Lane <tgl@sss.pgh.pa.us>

Commit: e15115b4d204989447203b12b905c66dfb6c0a78
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2020-10-16T15:59:47Z
Releases: 9.6.20
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

Files

PathChange+/−
contrib/pgcrypto/crypt-md5.c modified +7 −1

Discussion