]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix error handling in OBJ_add_object
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 27 Oct 2023 10:05:05 +0000 (12:05 +0200)
committerTomas Mraz <tomas@openssl.org>
Wed, 21 Aug 2024 13:53:37 +0000 (15:53 +0200)
commite91384d5b0547bf797e2b44976f142d146c4e650
tree07159a2883660ed3d641203ab2eeea09032b23bf
parent223e0020e47e6e8eb6079258ea9d563d1d115132
Fix error handling in OBJ_add_object

This fixes the possible memory leak in OBJ_add_object
when a pre-existing object is replaced by a new one,
with identical NID, OID, and/or short/long name.
We do not try to delete any orphans, but only mark
them as type == -1, because the previously returned
pointers from OBJ_nid2obj/OBJ_nid2sn/OBJ_nid2ln
may be cached by applications and can thus not
be cleaned up before the application terminates.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22534)
crypto/objects/obj_dat.c
test/evp_extra_test.c