[Commits] [SCM] claws branch, master, updated. 3.17.0-33-gb253d35

ticho at claws-mail.org ticho at claws-mail.org
Fri Aug 31 13:28:26 CEST 2018


The branch, master has been updated
       via  b253d35d119e2fdc7ac18e6c19c7baad35bf7d86 (commit)
      from  0b7583815089737f643414c7ad585c86b16d71ec (commit)

Summary of changes:
 src/common/md5.c |    8 ++++++++
 1 file changed, 8 insertions(+)


- Log -----------------------------------------------------------------
commit b253d35d119e2fdc7ac18e6c19c7baad35bf7d86
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Fri Aug 31 13:28:16 2018 +0200

    Add parameter sanity checks to md5_hex_digest() and md5_hex_hmac().

diff --git a/src/common/md5.c b/src/common/md5.c
index 9da14ea..03fbedc 100644
--- a/src/common/md5.c
+++ b/src/common/md5.c
@@ -384,6 +384,8 @@ md5_hex_digest_file(char *hexdigest, const unsigned char *file)
 void
 md5_hex_digest(char *hexdigest, const unsigned char *s)
 {
+	g_return_if_fail(hexdigest != NULL);
+	g_return_if_fail(s != NULL);
 	md5_hex_digest_binary(hexdigest, s, strlen(s));
 }
 
@@ -469,6 +471,12 @@ md5_hex_hmac(char *hexdigest,
 	unsigned char digest[16];
 	int i;
 
+	g_return_if_fail(key != NULL);
+	g_return_if_fail(key_len >= 0);
+	g_return_if_fail(text != NULL);
+	g_return_if_fail(text_len >= 0);
+	g_return_if_fail(hexdigest != NULL);
+
 	md5_hmac(digest, text, text_len, key, key_len);
 	for (i = 0; i < 16; i++)
 		sprintf(hexdigest + 2 * i, "%02x", digest[i]);

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list