Skip to content

Commit cfe2aaf

Browse files
static analysis and cast of argument
1 parent fbbd3aa commit cfe2aaf

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

examples/sftpclient/sftpclient.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ THREAD_RETURN WOLFSSH_THREAD sftpclient_test(void* args)
11271127
n = NULL;
11281128
}
11291129

1130-
ret = doCmds(args);
1130+
ret = doCmds((func_args*)args);
11311131
XFREE(workingDir, NULL, DYNAMIC_TYPE_TMP_BUFFER);
11321132
if (ret == WS_SUCCESS) {
11331133
if (wolfSSH_shutdown(ssh) != WS_SUCCESS) {

src/wolfscp.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,6 +2178,11 @@ int wsScpSendCallback(WOLFSSH* ssh, int state, const char* peerRequest,
21782178
}
21792179

21802180
ret = FindNextDirEntry(sendCtx);
2181+
2182+
/* help out static analysis tool */
2183+
if (ret != WS_BAD_ARGUMENT && sendCtx == NULL)
2184+
ret = WS_BAD_ARGUMENT;
2185+
21812186
if (ret == WS_SUCCESS || ret == WS_NEXT_ERROR) {
21822187

21832188
#ifdef WOLFSSL_NUCLEUS

0 commit comments

Comments
 (0)