From b735a6303b40d8787c5b277c4eaf46aee8a79965 Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Thu, 15 Jan 2015 20:14:32 +0100 Subject: [PATCH] mconn-crypt: be explicit about BIO memory dup --- src/mconn-crypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mconn-crypt.c b/src/mconn-crypt.c index a69d800..b116011 100644 --- a/src/mconn-crypt.c +++ b/src/mconn-crypt.c @@ -156,7 +156,7 @@ static gchar *__mconn_get_public_key_as_pem(MConnCryptPrivate *priv) g_assert(oss_pubkey != NULL); /* dup the key as buffer goes away with BIO */ - pubkey = g_strdup(oss_pubkey); + pubkey = g_strndup(oss_pubkey, data); BIO_set_close(bm, BIO_CLOSE); BIO_free(bm);