Skip to content

Commit cc7db42

Browse files
free name list after done and fix clean_path
1 parent 3ea6737 commit cc7db42

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

examples/sftpclient/sftpclient.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,7 @@ static int doAutopilot(int cmd, char* local, char* remote)
12321232
}
12331233
}
12341234

1235+
wolfSSH_SFTPNAME_list_free(name);
12351236
return ret;
12361237
}
12371238

src/internal.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8681,7 +8681,7 @@ void clean_path(char* path)
86818681
sz = (int)WSTRLEN(path);
86828682

86838683
/* remove any /./ patterns */
8684-
for (i = 0; i < sz; i++) {
8684+
for (i = 1; i + 1 < sz; i++) {
86858685
if (path[i] == '.' && path[i - 1] == WS_DELIM && path[i + 1] == WS_DELIM) {
86868686
WMEMMOVE(path + i, path + i + 1, sz - i + 1);
86878687
sz -= 1;
@@ -8830,6 +8830,7 @@ void DumpOctetString(const byte* input, word32 inputSz)
88308830
int wolfSSH_oct2dec(WOLFSSH* ssh, byte* oct, word32 octSz)
88318831
{
88328832
int ret;
8833+
word32 i;
88338834

88348835
if (octSz > WOLFSSH_MAX_OCTET_LEN || ssh == NULL || oct == NULL) {
88358836
return WS_BAD_ARGUMENT;
@@ -8838,7 +8839,7 @@ int wolfSSH_oct2dec(WOLFSSH* ssh, byte* oct, word32 octSz)
88388839
/* convert octal string to int without mp_read_radix() */
88398840
ret = 0;
88408841

8841-
for (word32 i = 0; i < octSz; i++)
8842+
for (i = 0; i < octSz; i++)
88428843
{
88438844
if (oct[i] < '0' || oct[0] > '7') {
88448845
ret = WS_BAD_ARGUMENT;

0 commit comments

Comments
 (0)