Skip to content
Commit 0b4721c7 authored by Bernd Edlinger's avatar Bernd Edlinger Committed by Tomas Mraz
Browse files

Fix unpredictible refcount handling of d2i functions



The passed in reference of a ref-counted object
is free'd by d2i functions in the error handling.
However if it is not the last reference, the
in/out reference variable is not set to null here.
This makes it impossible for the caller to handle
the error correctly, because there are numerous
cases where the passed in reference is free'd
and set to null, while in other cases, where the
passed in reference is not free'd, the reference
is left untouched.

Therefore the passed in reference must be set
to NULL even when it was not the last reference.

Fixes #23713

Reviewed-by: default avatarDmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: default avatarTomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22809)

(cherry picked from commit d550d2aa)
parent 43863a60
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment