summary refs log tree commit diff stats
path: root/crypto/hmac-gnutls.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/hmac-gnutls.c')
-rw-r--r--crypto/hmac-gnutls.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/hmac-gnutls.c b/crypto/hmac-gnutls.c
index 822995505c..3c5bcbe80b 100644
--- a/crypto/hmac-gnutls.c
+++ b/crypto/hmac-gnutls.c
@@ -119,7 +119,9 @@ qcrypto_gnutls_hmac_bytesv(QCryptoHmac *hmac,
         return -1;
     }
 
-    if (*resultlen == 0) {
+    if (resultlen == NULL) {
+        return 0;
+    } else if (*resultlen == 0) {
         *resultlen = ret;
         *result = g_new0(uint8_t, *resultlen);
     } else if (*resultlen != ret) {