Re: Is X509_free(NULL) ok?

Ken Goldman <[email protected]> Fri, 22 Dec 2017 10:15:46 -0500
Newsgroups gmane.comp.encryption.openssl.devel,gmane.comp.encryption.openssl.user
Message-ID <[email protected]>
On 12/22/2017 9:59 AM, Salz, Rich via openssl-dev wrote:
> 
> I think we fixed all such cases in 1.1.0, all *_free()
> functions should handle NULL. I don't think we backported to changes
> to 1.0.2.
> 
> Yes, and we fixed the documentation.  I backported all/most of them
> to 1.0.2 to make cherry-picking easier.  I don’t know if I changed
> the docs.

So it's guaranteed for 1.1, mostly guaranteed for recent 1.0.2, but not
guaranteed for older 1.0.2.

If that's the case, I suspect it's just as easy to leave the

	if (ptr != NULL)

in the code, as to code an ifdef for version < 1.1.

~~

I also think it would be good to backport all to 1.0.2.  If the 
documentation says it's OK in 1.1, and the coder uses the 1.1 API,
the end user may get crashes if they compile against 1.0.2.

	


-- 
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev