From d9c25796473e750eb273b68bc36576f5713cd0f1 Mon Sep 17 00:00:00 2001 From: Elizabeth Jennifer Myers Date: Tue, 22 Feb 2011 12:00:45 -0500 Subject: [PATCH] m_challenge: fix use of undefined behaviour. GCC does what we expect, but other compilers could do just about anything. --- modules/m_challenge.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/m_challenge.c b/modules/m_challenge.c index 73f8e90..2066095 100644 --- a/modules/m_challenge.c +++ b/modules/m_challenge.c @@ -142,7 +142,8 @@ m_challenge(struct Client *client_p, struct Client *source_p, int parc, const ch return 0; } - b_response = rb_base64_decode((const unsigned char *)++parv[1], strlen(parv[1]), &len); + parv[1]++; + b_response = rb_base64_decode((const unsigned char *)parv[1], strlen(parv[1]), &len); if(len != SHA_DIGEST_LENGTH || memcmp(source_p->localClient->challenge, b_response, SHA_DIGEST_LENGTH))