/soc/2013/ankitkv/gobjectification: 9e916edd668b: Merged soc.201...

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


Changeset: 9e916edd668baf03a5f99a046eedd4070d5d829e
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-08-22 01:40 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/9e916edd668b

Description:

Merged soc.2013.gobjectification branch

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