Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connection check on wolfSSH_SFTP_STAT #707

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/wolfsftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -6675,6 +6675,7 @@ static int SFTP_STAT(WOLFSSH* ssh, char* dir, WS_SFTP_FILEATRB* atr, byte type)
{
WS_SFTP_LSTAT_STATE* state = NULL;
int ret;
int ret_fatal = 0;
word32 localIdx;

WLOG(WS_LOG_SFTP, "Entering SFTP_STAT()");
Expand Down Expand Up @@ -6716,6 +6717,7 @@ static int SFTP_STAT(WOLFSSH* ssh, char* dir, WS_SFTP_FILEATRB* atr, byte type)
ssh->error == WS_WANT_WRITE)
return WS_FATAL_ERROR;
else {
ret_fatal = 1;
state->state = STATE_LSTAT_CLEANUP;
continue;
}
Expand All @@ -6734,6 +6736,7 @@ static int SFTP_STAT(WOLFSSH* ssh, char* dir, WS_SFTP_FILEATRB* atr, byte type)
return WS_FATAL_ERROR;
else {
state->state = STATE_LSTAT_CLEANUP;
ret_fatal = 1;
continue;
}
}
Expand Down Expand Up @@ -6815,7 +6818,10 @@ static int SFTP_STAT(WOLFSSH* ssh, char* dir, WS_SFTP_FILEATRB* atr, byte type)
WFREE(ssh->lstatState, ssh->ctx->heap, DYNTYPE_SFTP_STATE);
ssh->lstatState = NULL;
}
return WS_SUCCESS;
if(ret_fatal)
return WS_FATAL_ERROR;
else
return WS_SUCCESS;

default:
WLOG(WS_LOG_SFTP, "Bad SFTP LSTAT state, program error");
Expand Down
Loading