From 6037d0bba8530b18abe14abe800f1bf84db08915 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Wed, 30 Oct 2024 09:43:13 -0600 Subject: [PATCH] error out when buffer is too small for null terminator --- src/internal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/internal.c b/src/internal.c index 2cff6ddf..d041a692 100644 --- a/src/internal.c +++ b/src/internal.c @@ -15736,6 +15736,9 @@ int wolfSSH_GetPath(const char* defaultPath, byte* in, word32 inSz, if (curSz < *outSz) { out[curSz] = 0; } + else { + return WS_BUFFER_E; + } } *outSz = curSz;