All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix: use of g_checksum_get_digest() inout argument
@ 2010-03-29 13:38 ppessi
  2010-03-30  1:14 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: ppessi @ 2010-03-29 13:38 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 621 bytes --]

From: Pekka Pessi <Pekka.Pessi@nokia.com>

---
 gatchat/ppp_auth.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gatchat/ppp_auth.c b/gatchat/ppp_auth.c
index fe3c501..1e0c82b 100644
--- a/gatchat/ppp_auth.c
+++ b/gatchat/ppp_auth.c
@@ -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? */
 	}
 
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix: use of g_checksum_get_digest() inout argument
  2010-03-29 13:38 [PATCH] Fix: use of g_checksum_get_digest() inout argument ppessi
@ 2010-03-30  1:14 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2010-03-30  1:14 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 865 bytes --]

Hi Pekka,

>  gatchat/ppp_auth.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/gatchat/ppp_auth.c b/gatchat/ppp_auth.c
> index fe3c501..1e0c82b 100644
> --- a/gatchat/ppp_auth.c
> +++ b/gatchat/ppp_auth.c
> @@ -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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-30  1:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-29 13:38 [PATCH] Fix: use of g_checksum_get_digest() inout argument ppessi
2010-03-30  1:14 ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.