Skip to content

Commit 2c710dc

Browse files
authored
Merge pull request #251 from JacobBarthelmeh/sftp
free name list after done and fix clean_path
2 parents e043b94 + cc7db42 commit 2c710dc

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
@@ -8693,7 +8693,7 @@ void clean_path(char* path)
86938693
sz = (int)WSTRLEN(path);
86948694

86958695
/* remove any /./ patterns */
8696-
for (i = 0; i < sz; i++) {
8696+
for (i = 1; i + 1 < sz; i++) {
86978697
if (path[i] == '.' && path[i - 1] == WS_DELIM && path[i + 1] == WS_DELIM) {
86988698
WMEMMOVE(path + i, path + i + 1, sz - i + 1);
86998699
sz -= 1;
@@ -8842,6 +8842,7 @@ void DumpOctetString(const byte* input, word32 inputSz)
88428842
int wolfSSH_oct2dec(WOLFSSH* ssh, byte* oct, word32 octSz)
88438843
{
88448844
int ret;
8845+
word32 i;
88458846

88468847
if (octSz > WOLFSSH_MAX_OCTET_LEN || ssh == NULL || oct == NULL) {
88478848
return WS_BAD_ARGUMENT;
@@ -8850,7 +8851,7 @@ int wolfSSH_oct2dec(WOLFSSH* ssh, byte* oct, word32 octSz)
88508851
/* convert octal string to int without mp_read_radix() */
88518852
ret = 0;
88528853

8853-
for (word32 i = 0; i < octSz; i++)
8854+
for (i = 0; i < octSz; i++)
88548855
{
88558856
if (oct[i] < '0' || oct[0] > '7') {
88568857
ret = WS_BAD_ARGUMENT;

0 commit comments

Comments
 (0)