0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-10 12:38:36 +02:00

m_challenge: fix use of undefined behaviour.

GCC does what we expect, but other compilers could do just about anything.
This commit is contained in:
Elizabeth Jennifer Myers 2011-02-22 12:00:45 -05:00
parent f4b52a0ad3
commit 6493f05d8c

View file

@ -143,7 +143,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))