Fix memcpy with incorrect destination
authorAndré Klitzing <aklitzing@gmail.com>
Mon, 17 Nov 2014 17:41:05 +0000 (18:41 +0100)
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>
Tue, 18 Nov 2014 05:48:04 +0000 (06:48 +0100)
Variable dsa is assigned in this block with q_DSA_new instead of rsa.
So this should be the destination of memcpy.

Change-Id: Id5a41d99f1606bf525ad5f819bbc06bb1235bf5b
Reviewed-by: Richard J. Moore <rich@kde.org>
src/network/ssl/qsslkey_openssl.cpp

index 6b0fa954eb0516a575e61c8e131dd79a6f6c0841..e4d30ff229b355379e6377ffb4f7b95741653d2f 100644 (file)
@@ -95,7 +95,7 @@ bool QSslKeyPrivate::fromEVP_PKEY(EVP_PKEY *pkey)
         type = QSsl::PrivateKey;
 
         dsa = q_DSA_new();
-        memcpy(rsa, q_EVP_PKEY_get1_DSA(pkey), sizeof(DSA));
+        memcpy(dsa, q_EVP_PKEY_get1_DSA(pkey), sizeof(DSA));
 
         return true;
     }