Add missing error check in pgcrypto/crypt-md5.c.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 16 Oct 2020 15:59:13 +0000 (11:59 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 16 Oct 2020 15:59:52 +0000 (11:59 -0400)
commit9c3032881e00eb92a6bb4fad966831881e9c3b41
tree441f407ce6721b95496e40d901e197e3abf9b1f2
parentb05672c725d62760ce7cba1150975b17aba5e29b
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: http://postgr.es/m/AA8D6FE9-4AB2-41B4-98CB-AE64BA668C03@yesql.se
contrib/pgcrypto/crypt-md5.c