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