mirror of https://github.com/wolfSSL/wolfssh.git
F-5852 - Only treat /.. as parent traversal in CleanPath
parent
091310a1eb
commit
ea22e2962a
|
|
@ -19885,8 +19885,9 @@ int wolfSSH_CleanPath(WOLFSSH* ssh, char* in, int inSz)
|
|||
if (path[i] == WS_DELIM) {
|
||||
int z;
|
||||
|
||||
/* if next two chars are .. then delete */
|
||||
if (path[i+1] == '.' && path[i+2] == '.') {
|
||||
/* delete only a real ".." segment, not "..name" */
|
||||
if (path[i+1] == '.' && path[i+2] == '.' &&
|
||||
(path[i+3] == WS_DELIM || path[i+3] == '\0')) {
|
||||
enIdx = i + 3;
|
||||
|
||||
/* start at one char before / and retrace path */
|
||||
|
|
|
|||
Loading…
Reference in New Issue