From dae8d0433015f531b64e3399069bb85b0d64d16f Mon Sep 17 00:00:00 2001 From: Selva Nair Date: Tue, 16 Apr 2024 17:26:34 -0400 Subject: [PATCH] Fix off-by-one error in escape_string() Github: fixes openvpn/openvpn-gui#548 Signed-off-by: Selva Nair --- misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc.c b/misc.c index 37d0cb1e2..4f278f6a4 100644 --- a/misc.c +++ b/misc.c @@ -208,7 +208,7 @@ escape_string(const char *input) return NULL; } out = buf; - memmove(out + pos + 1, out + pos, len - pos + 1); + memmove(out + pos + 1, out + pos, len - pos); out[pos] = '\\'; pos += 1; }