Fix old bug in contrib/sslinfo: X509_NAME_to_text freed the BIO_s_mem buffer

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 8f74153732c512baa498eb6c38244c0d3a09dff8
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2008-11-10T14:57:53Z
Releases: 8.2.12
Fix old bug in contrib/sslinfo: X509_NAME_to_text freed the BIO_s_mem buffer
it was using too soon.  In a situation where pg_do_encoding_conversion is
a no-op, this led to garbage data returned.

In HEAD, also modify the code that's ensuring null termination to make it
a tad more obvious what's happening.

Files

PathChange+/−
contrib/sslinfo/sslinfo.c modified +3 −8