diff --git a/examples/sftpclient/sftpclient.c b/examples/sftpclient/sftpclient.c index ae4a1569..98a7cdde 100644 --- a/examples/sftpclient/sftpclient.c +++ b/examples/sftpclient/sftpclient.c @@ -1127,7 +1127,7 @@ THREAD_RETURN WOLFSSH_THREAD sftpclient_test(void* args) n = NULL; } - ret = doCmds(args); + ret = doCmds((func_args*)args); XFREE(workingDir, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (ret == WS_SUCCESS) { if (wolfSSH_shutdown(ssh) != WS_SUCCESS) { diff --git a/src/wolfscp.c b/src/wolfscp.c index 97428bf5..3b8ccd07 100644 --- a/src/wolfscp.c +++ b/src/wolfscp.c @@ -2178,6 +2178,11 @@ int wsScpSendCallback(WOLFSSH* ssh, int state, const char* peerRequest, } ret = FindNextDirEntry(sendCtx); + + /* help out static analysis tool */ + if (ret != WS_BAD_ARGUMENT && sendCtx == NULL) + ret = WS_BAD_ARGUMENT; + if (ret == WS_SUCCESS || ret == WS_NEXT_ERROR) { #ifdef WOLFSSL_NUCLEUS