From: Philippe Antoine Date: Thu, 3 Nov 2022 12:27:10 +0000 (+0100) Subject: clean: replace MD5_STRING_LENGTH with more used SC_MD5_HEX_LEN X-Git-Tag: suricata-7.0.0-rc1~400 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7823653a3049bd6c63c5c896b7c97bfd78d0b110;p=thirdparty%2Fsuricata.git clean: replace MD5_STRING_LENGTH with more used SC_MD5_HEX_LEN --- diff --git a/src/util-ja3.c b/src/util-ja3.c index e17edb0dae..270e3e42d8 100644 --- a/src/util-ja3.c +++ b/src/util-ja3.c @@ -30,8 +30,6 @@ #include "detect-engine.h" -#define MD5_STRING_LENGTH 33 - /** * \brief Allocate new buffer. * @@ -226,14 +224,14 @@ char *Ja3GenerateHash(JA3Buffer *buffer) return NULL; } - char *ja3_hash = SCMalloc(MD5_STRING_LENGTH); + char *ja3_hash = SCMalloc(SC_MD5_HEX_LEN + 1); if (ja3_hash == NULL) { SCLogError(SC_ERR_MEM_ALLOC, "Error allocating memory for JA3 hash"); return NULL; } - SCMd5HashBufferToHex((unsigned char *)buffer->data, buffer->used, ja3_hash, MD5_STRING_LENGTH); + SCMd5HashBufferToHex((unsigned char *)buffer->data, buffer->used, ja3_hash, SC_MD5_HEX_LEN + 1); return ja3_hash; }