From 621de565e15f9301b1e735b4c758fb805da57d86 Mon Sep 17 00:00:00 2001 From: w00t Date: Wed, 9 Apr 2008 10:17:28 +0000 Subject: Apply brain's patch for binary safety of hash providers, and remove rehash from windows project (manually applied that due to linefeed shit) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9441 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_md5.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/modules/m_md5.cpp') diff --git a/src/modules/m_md5.cpp b/src/modules/m_md5.cpp index 402007177..6096f9afa 100644 --- a/src/modules/m_md5.cpp +++ b/src/modules/m_md5.cpp @@ -245,11 +245,11 @@ class ModuleMD5 : public Module } - void GenHash(const char* src, char* dest, const char* xtab, unsigned int* ikey) + void GenHash(const char* src, char* dest, const char* xtab, unsigned int* ikey, size_t srclen) { unsigned char bytes[16]; - MyMD5((char*)bytes, (void*)src, strlen(src), ikey); + MyMD5((char*)bytes, (void*)src, srclen, ikey); for (int i = 0; i < 16; i++) { @@ -293,7 +293,7 @@ class ModuleMD5 : public Module else if (strcmp("SUM", request->GetId()) == 0) { static char data[MAXBUF]; - GenHash((const char*)MD5->GetHashData(), data, chars ? chars : "0123456789abcdef", key); + GenHash(MD5->GetHashData().data(), data, chars ? chars : "0123456789abcdef", key, MD5->GetHashData().length()); return data; } else if (strcmp("NAME", request->GetId()) == 0) -- cgit v1.2.3