rpc: avoid uninitialized memory use

Spotted by Coverity.  Gnutls documents that buffer must be NULL
if gnutls_x509_crt_get_key_purpose_oid is to be used to determine
the correct size needed for allocating a buffer.

* src/rpc/virnettlscontext.c
(virNetTLSContextCheckCertKeyPurpose): Initialize buffer.
This commit is contained in:
Eric Blake 2011-08-02 09:56:10 -06:00
parent 50ae1de27c
commit 3157d78f52

View File

@ -264,7 +264,7 @@ static int virNetTLSContextCheckCertKeyPurpose(gnutls_x509_crt_t cert,
int i;
unsigned int purposeCritical;
unsigned int critical;
char *buffer;
char *buffer = NULL;
size_t size;
bool allowClient = false, allowServer = false;