Skip to content
Snippets Groups Projects
Commit d07ece63 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Allow init_sftp() to safely be called twice.

This prevents the case where input_thread() accepts the sftp
connection and calls init_sftp(), then answer() does the same thing,
clobbering the previous state.
parent 4ec008ed
No related branches found
No related tags found
No related merge requests found
Pipeline #6014 canceled
...@@ -1778,6 +1778,8 @@ sftp_symlink(sftp_str_t linkpath, sftp_str_t targetpath, void *cb_data) ...@@ -1778,6 +1778,8 @@ sftp_symlink(sftp_str_t linkpath, sftp_str_t targetpath, void *cb_data)
bool bool
sbbs_t::init_sftp(int cid) sbbs_t::init_sftp(int cid)
{ {
if (sftp_state != nullptr)
return true;
sftp_state = sftps_begin(sftp_send, this); sftp_state = sftps_begin(sftp_send, this);
if (sftp_state != nullptr) { if (sftp_state != nullptr) {
sftp_state->lprintf = sftp_lprintf; sftp_state->lprintf = sftp_lprintf;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment