summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/wee-secure.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/wee-secure.c b/src/core/wee-secure.c
index 18a8ee52b..064f080bb 100644
--- a/src/core/wee-secure.c
+++ b/src/core/wee-secure.c
@@ -179,6 +179,9 @@ secure_derive_key (const char *salt, const char *passphrase,
int length, length_hash;
gcry_md_hd_t hd_md;
+ if (!salt || !passphrase || !key || (length_key < 1))
+ return 0;
+
memset (key, 0, length_key);
length = SECURE_SALT_SIZE + strlen (passphrase);