From 9da927889f4eb621a912cb7775baa6e23e0af33a Mon Sep 17 00:00:00 2001 From: Naram Qashat Date: Wed, 4 Aug 2010 21:48:40 -0400 Subject: Fix enc_md5 to work with the way the new b64_encode does things with Anope::string, by making sure that the string is null terminated properly. --- modules/core/enc_md5.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/core') diff --git a/modules/core/enc_md5.cpp b/modules/core/enc_md5.cpp index 28927af33..fefcb6ce0 100644 --- a/modules/core/enc_md5.cpp +++ b/modules/core/enc_md5.cpp @@ -170,7 +170,7 @@ void MD5Update(MD5_CTX *context, const unsigned char *input, unsigned inputLen) /* MD5 finalization. Ends an MD5 message-digest operation, writing the * the message digest and zeroizing the context. */ -void MD5Final(unsigned char digest[16], MD5_CTX *context) +void MD5Final(unsigned char digest[17], MD5_CTX *context) { unsigned char bits[8]; unsigned index, padLen; @@ -328,7 +328,7 @@ class EMD5 : public Module EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) { MD5_CTX context; - unsigned char digest[16] = ""; + unsigned char digest[17] = ""; Anope::string buf = "md5:"; Anope::string cpass; -- cgit