From 7823653a3049bd6c63c5c896b7c97bfd78d0b110 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Thu, 3 Nov 2022 13:27:10 +0100 Subject: [PATCH] clean: replace MD5_STRING_LENGTH with more used SC_MD5_HEX_LEN --- src/util-ja3.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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; }