aboutsummaryrefslogtreecommitdiff
path: root/crypto/hmac-gcrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/hmac-gcrypt.c')
-rw-r--r--crypto/hmac-gcrypt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/hmac-gcrypt.c b/crypto/hmac-gcrypt.c
index 5273086..e428d17 100644
--- a/crypto/hmac-gcrypt.c
+++ b/crypto/hmac-gcrypt.c
@@ -121,7 +121,9 @@ qcrypto_gcrypt_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) {