/soc/2013/ankitkv/gobjectification: 573a6bcfb8af: Merged changes...

Ankit Vani a at nevitus.org
Wed Aug 21 16:13:10 EDT 2013


Changeset: 573a6bcfb8af45775f1f5a4c9f79dcac5a602856
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-08-22 01:39 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/573a6bcfb8af

Description:

Merged changes to gchecksum cipher

diffstat:

 libpurple/ciphers/md5hash.c    |  6 ++++--
 libpurple/ciphers/sha1hash.c   |  6 ++++--
 libpurple/ciphers/sha256hash.c |  6 ++++--
 3 files changed, 12 insertions(+), 6 deletions(-)

diffs (57 lines):

diff --git a/libpurple/ciphers/md5hash.c b/libpurple/ciphers/md5hash.c
--- a/libpurple/ciphers/md5hash.c
+++ b/libpurple/ciphers/md5hash.c
@@ -83,11 +83,13 @@ purple_md5_hash_digest(PurpleHash *hash,
 
 	g_return_val_if_fail(priv != NULL, FALSE);
 	g_return_val_if_fail(priv->checksum != NULL, FALSE);
-	g_return_val_if_fail(buff_len >= required_len, FALSE);
+
+	g_return_val_if_fail(required_len >= 0, FALSE);
+	g_return_val_if_fail(buff_len >= (gsize)required_len, FALSE);
 
 	g_checksum_get_digest(priv->checksum, digest, &digest_len);
 
-	if (digest_len != required_len)
+	if (digest_len != (gsize)required_len)
 		return FALSE;
 
 	purple_md5_hash_reset(hash);
diff --git a/libpurple/ciphers/sha1hash.c b/libpurple/ciphers/sha1hash.c
--- a/libpurple/ciphers/sha1hash.c
+++ b/libpurple/ciphers/sha1hash.c
@@ -83,11 +83,13 @@ purple_sha1_hash_digest(PurpleHash *hash
 
 	g_return_val_if_fail(priv != NULL, FALSE);
 	g_return_val_if_fail(priv->checksum != NULL, FALSE);
-	g_return_val_if_fail(buff_len >= required_len, FALSE);
+
+	g_return_val_if_fail(required_len >= 0, FALSE);
+	g_return_val_if_fail(buff_len >= (gsize)required_len, FALSE);
 
 	g_checksum_get_digest(priv->checksum, digest, &digest_len);
 
-	if (digest_len != required_len)
+	if (digest_len != (gsize)required_len)
 		return FALSE;
 
 	purple_sha1_hash_reset(hash);
diff --git a/libpurple/ciphers/sha256hash.c b/libpurple/ciphers/sha256hash.c
--- a/libpurple/ciphers/sha256hash.c
+++ b/libpurple/ciphers/sha256hash.c
@@ -83,11 +83,13 @@ purple_sha256_hash_digest(PurpleHash *ha
 
 	g_return_val_if_fail(priv != NULL, FALSE);
 	g_return_val_if_fail(priv->checksum != NULL, FALSE);
-	g_return_val_if_fail(buff_len >= required_len, FALSE);
+
+	g_return_val_if_fail(required_len >= 0, FALSE);
+	g_return_val_if_fail(buff_len >= (gsize)required_len, FALSE);
 
 	g_checksum_get_digest(priv->checksum, digest, &digest_len);
 
-	if (digest_len != required_len)
+	if (digest_len != (gsize)required_len)
 		return FALSE;
 
 	purple_sha256_hash_reset(hash);



More information about the Commits mailing list