Skip to content

Commit fc8b390

Browse files
committed
Bug#35764496: Running too much data through MD5() causes
server stop The parameter type to the helper functions was int and was truncating the value passed. Fixed by making sure the length parameter is consistent. Change-Id: Ifd92be58982cf89548243a6351565596e385f0e5
1 parent f109fbd commit fc8b390

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/my_md5.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
extern "C" {
3434
#endif
3535

36-
void compute_md5_hash(char *digest, const char *buf, int len);
36+
void compute_md5_hash(char *digest, const char *buf, size_t len);
3737

3838
/*
3939
Convert an array of bytes to a hexadecimal representation.

mysys_ssl/my_md5.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#if defined(HAVE_OPENSSL)
4040
#include <openssl/md5.h>
4141

42-
static void my_md5_hash(unsigned char* digest, unsigned const char *buf, int len)
42+
static void my_md5_hash(unsigned char* digest, unsigned const char *buf, size_t len)
4343
{
4444
MD5_CTX ctx;
4545
MD5_Init (&ctx);
@@ -58,7 +58,7 @@ static void my_md5_hash(unsigned char* digest, unsigned const char *buf, int len
5858
5959
@return void
6060
*/
61-
void compute_md5_hash(char *digest, const char *buf, int len)
61+
void compute_md5_hash(char *digest, const char *buf, size_t len)
6262
{
6363
#if defined(HAVE_OPENSSL)
6464
my_md5_hash((unsigned char*)digest, (unsigned const char*)buf, len);

0 commit comments

Comments
 (0)