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

Fix some especially silly Coverity "issues"

These are regarding initializing variables at the same time as the
mutex.

Harmless.
parent f2cd7856
No related branches found
No related tags found
No related merge requests found
Pipeline #5925 passed
...@@ -1944,9 +1944,11 @@ int bitmap_drv_init(void (*drawrect_cb) (struct rectlist *data) ...@@ -1944,9 +1944,11 @@ int bitmap_drv_init(void (*drawrect_cb) (struct rectlist *data)
pthread_mutex_unlock(&screenlock); pthread_mutex_unlock(&screenlock);
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_lock(&callbacks.lock);
callbacks.drawrect=drawrect_cb; callbacks.drawrect=drawrect_cb;
callbacks.flush=flush_cb; callbacks.flush=flush_cb;
callbacks.rects = 0; callbacks.rects = 0;
pthread_mutex_unlock(&callbacks.lock);
bitmap_initialized=1; bitmap_initialized=1;
_beginthread(blinker_thread,0,NULL); _beginthread(blinker_thread,0,NULL);
......
...@@ -691,11 +691,13 @@ ssh_connect(struct bbslist *bbs) ...@@ -691,11 +691,13 @@ ssh_connect(struct bbslist *bbs)
CRYPT_CONTEXT ssh_context; CRYPT_CONTEXT ssh_context;
char *pubkey = NULL; char *pubkey = NULL;
ssh_channel = -1;
sftp_channel = -1;
if (!bbs->hidepopups) if (!bbs->hidepopups)
init_uifc(true, true); init_uifc(true, true);
pthread_mutex_init(&ssh_mutex, NULL); pthread_mutex_init(&ssh_mutex, NULL);
pthread_mutex_lock(&ssh_mutex);
ssh_channel = -1;
sftp_channel = -1;
pthread_mutex_unlock(&ssh_mutex);
pthread_mutex_init(&ssh_tx_mutex, NULL); pthread_mutex_init(&ssh_tx_mutex, NULL);
get_syncterm_filename(path, sizeof(path), SYNCTERM_PATH_KEYS, false); get_syncterm_filename(path, sizeof(path), SYNCTERM_PATH_KEYS, false);
...@@ -1021,7 +1023,10 @@ ssh_close(void) ...@@ -1021,7 +1023,10 @@ ssh_close(void)
cryptSetAttribute(ssh_session, CRYPT_OPTION_NET_READTIMEOUT, 1); cryptSetAttribute(ssh_session, CRYPT_OPTION_NET_READTIMEOUT, 1);
cryptSetAttribute(ssh_session, CRYPT_OPTION_NET_WRITETIMEOUT, 1); cryptSetAttribute(ssh_session, CRYPT_OPTION_NET_WRITETIMEOUT, 1);
conn_api.terminate = 1; conn_api.terminate = 1;
close_sftp_channel(sftp_channel); pthread_mutex_lock(&ssh_mutex);
int sc = sftp_channel;
pthread_mutex_unlock(&ssh_mutex);
close_sftp_channel(sc);
close_ssh_channel(); close_ssh_channel();
ssh_active = false; ssh_active = false;
while (conn_api.input_thread_running == 1 || conn_api.output_thread_running == 1 || pubkey_thread_running) { while (conn_api.input_thread_running == 1 || conn_api.output_thread_running == 1 || pubkey_thread_running) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment