Fix an off by one error.

pull/859/head
Anthony Hu 2025-12-30 11:03:31 -05:00
parent 3e538274df
commit 65f01e7c7a
1 changed files with 1 additions and 1 deletions

View File

@ -17007,7 +17007,7 @@ int wolfSSH_CleanPath(WOLFSSH* ssh, char* in)
/* remove any /./ patterns, direcotries, exclude cases like ./ok./test */
for (i = 1; i + 1 < sz; i++) {
if (path[i] == '.' && path[i - 1] == WS_DELIM && path[i + 1] == WS_DELIM) {
WMEMMOVE(path + (i-1), path + (i+1), sz - (i-1));
WMEMMOVE(path + (i-1), path + (i+1), sz - i);
sz -= 2; /* removed '/.' from string*/
i--;
}