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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

Tom Lane-2
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@...

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3d338a46a4c342fa1a4e276e0c84532141f4264b

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