Skip to contentSkip to conversation

Fix: use of g_checksum_get_digest() inout argument

PATCH In review [email protected] 2 participants 2 messages Mar 29, 2010 – Mar 30, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix: use of g_checksum_get_digest() inout argument

From: Pekka Pessi <[email protected]>

---
 gatchat/ppp_auth.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
gatchat/ppp_auth.c +1 -1
index fe3c501..1e0c82b 100644
@@ -107,7 +107,7 @@ static void chap_process_challenge(struct auth_data *auth, guint8 *packet)
 		response->length = htons(response_length);
 		response->data[0] = digest_len;
 		g_checksum_get_digest(checksum, &response->data[1],
-					(gsize *) &response->data[0]);
+					&digest_len);
 		/* leave the name empty? */
 	}
 
Signature · 1 line
1.6.3.3
#1 lore raw

Hi Pekka,

Quoted 8 lines
 gatchat/ppp_auth.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
gatchat/ppp_auth.c +0 -0
index fe3c501..1e0c82b 100644

gatchat/ppp_auth.c static void chap_process_challenge(struct auth_data *auth, guint8 *packet) · line 112

Quoted 7 lines
gatchat/ppp_auth.c +1 -1
@@ -107,7 +107,7 @@ static void chap_process_challenge(struct auth_data *auth, guint8 *packet)
 		response->length = htons(response_length);
 		response->data[0] = digest_len;
 		g_checksum_get_digest(checksum, &response->data[1],
-					(gsize *) &response->data[0]);
+					&digest_len);
 		/* leave the name empty? */
 	}

thanks for the patch. I changed it a bit by moving the data[0] assignment after the get_digest call to ensure we use the right length value on the wire. Not that it matters in this case since it is a fixed length anyway, but just in case.

Regards

Marcel