From 12a4517d6b933f0e7b910fee475de51b87fe2881 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 15 Jul 2021 22:38:48 +0700 Subject: [PATCH] handle edge case of input buffer malloc'd to location immediately after output buffer --- src/internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index e424da276..02fe503a3 100644 --- a/src/internal.c +++ b/src/internal.c @@ -8525,7 +8525,7 @@ static int SendHandshakeMsg(WOLFSSL* ssl, byte* input, word32 inputSz, /* Make sure input is not the ssl output buffer as this * function doesn't handle that */ if (input >= ssl->buffers.outputBuffer.buffer && - input <= ssl->buffers.outputBuffer.buffer + + input < ssl->buffers.outputBuffer.buffer + ssl->buffers.outputBuffer.bufferSize) { WOLFSSL_MSG("Can't use output buffer for input in SendHandshakeMsg"); return BAD_FUNC_ARG;