pgsql: pgcrypto: avoid recursive ResourceOwnerForget().

Started by Tom Laneabout 1 month ago1 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

pgcrypto: avoid recursive ResourceOwnerForget().

Raising an error within a function using an OSSLCipher object led
to a complaint from ResourceOwnerForget and then a double-free crash,
because ResOwnerReleaseOSSLCipher forgot to unhook the OSSLCipher
object from its owner. (The sibling logic for OSSLDigest objects got
this right, as did every other ReleaseResource function AFAICS.)

Oversight in cd694f60d.

Bug: #19527
Reported-by: Yuelin Wang <3020001251@tju.edu.cn>
Author: Yuelin Wang <3020001251@tju.edu.cn>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: /messages/by-id/19527-6e7686960c6dce78@postgresql.org
Backpatch-through: 17

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/80bb0ebcc11fb9cb5904d490640408b3d7003a17

Modified Files
--------------
contrib/pgcrypto/openssl.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)