From fdf457d3a6fbdae3d1bb3764a28f69ab21d99b40 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 37d0cb1..4f278f6 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; }