mirror of https://github.com/wolfSSL/wolfssh.git
Merge pull request #305 from guidovranken/oss-fuzz-27436
Fix memmove length calculation in wolfSSH_CleanPathpull/312/head
commit
34cfc52961
|
@ -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--;
|
||||
}
|
||||
|
|
|
@ -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--;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue