util-ja3: fix AddressSanitizer heap-buffer-overflow

No resizing is done in Ja3BufferResizeIfFull() when the buffer is
empty. This leads to a potential overflow when this happens, since
a ',' is appended even when the buffer is empty.

Bug #2762
pull/3673/head
Mats Klepsland 7 years ago committed by Victor Julien
parent 932e5dedc2
commit 22d8fc802e

@ -77,10 +77,6 @@ static int Ja3BufferResizeIfFull(JA3Buffer *buffer, uint32_t len)
{
DEBUG_VALIDATE_BUG_ON(buffer == NULL);
if (len == 0) {
return 0;
}
while (buffer->used + len + 2 > buffer->size)
{
buffer->size *= 2;

Loading…
Cancel
Save