Merge pull request #305 from guidovranken/oss-fuzz-27436

Fix memmove length calculation in wolfSSH_CleanPath
pull/312/head
JacobBarthelmeh 2021-01-27 02:50:25 +07:00 committed by GitHub
commit 34cfc52961
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -168,7 +168,7 @@ static void clean_path(char* path)
/* remove any double '/' chars */
for (i = 0; i < sz; i++) {
if (path[i] == '/' && path[i+1] == '/') {
WMEMMOVE(path + i, path + i + 1, sz - i + 1);
WMEMMOVE(path + i, path + i + 1, sz - i);
sz -= 1;
i--;
}

View File

@ -9558,7 +9558,7 @@ int wolfSSH_CleanPath(WOLFSSH* ssh, char* in)
/* remove any double '/' or '\' chars */
for (i = 0; i < sz; i++) {
if ((path[i] == WS_DELIM && path[i+1] == WS_DELIM)) {
WMEMMOVE(path + i, path + i + 1, sz - i + 1);
WMEMMOVE(path + i, path + i + 1, sz - i);
sz -= 1;
i--;
}