From 097c7a1e0af7d055a19f6f386231c2e5166d3d4a Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 17 Jun 2026 14:22:39 +0200 Subject: [PATCH] process: Correctly read last path character on Windows Fixes: 7dd06d274da5 ("process: Add a wrapper to invoke a command under the system default shell") --- src/libstrongswan/utils/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstrongswan/utils/process.c b/src/libstrongswan/utils/process.c index 5c34449ab..35e8e5b0f 100644 --- a/src/libstrongswan/utils/process.c +++ b/src/libstrongswan/utils/process.c @@ -571,7 +571,7 @@ process_t* process_start_shell(char *const envp[], int *in, int *out, int *err, GetLastError()); return NULL; } - if (path[len + 1] != '\\') + if (path[len - 1] != '\\') { strncat(path, "\\", sizeof(path) - len++); }