Skip to content
Snippets Groups Projects
Commit 60252991 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix CID 469129 and 469141 using std::atomic<>

Unlikely, but valid thread-safety concerns by Coverity
parent 0de71f4c
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -377,6 +377,7 @@ typedef struct js_callback { ...@@ -377,6 +377,7 @@ typedef struct js_callback {
/* Synchronet Node Instance class definition */ /* Synchronet Node Instance class definition */
#if defined(__cplusplus) && defined(JAVASCRIPT) #if defined(__cplusplus) && defined(JAVASCRIPT)
#include <atomic>
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
...@@ -414,7 +415,7 @@ public: ...@@ -414,7 +415,7 @@ public:
CRYPT_SESSION ssh_session=-1; CRYPT_SESSION ssh_session=-1;
#endif #endif
int session_channel=-1; int session_channel=-1;
bool ssh_mode = false; std::atomic<bool> ssh_mode = false;
SOCKET passthru_socket=INVALID_SOCKET; SOCKET passthru_socket=INVALID_SOCKET;
bool passthru_socket_active = false; bool passthru_socket_active = false;
void passthru_socket_activate(bool); void passthru_socket_activate(bool);
...@@ -467,7 +468,7 @@ public: ...@@ -467,7 +468,7 @@ public:
uchar telnet_cmd[64]{}; uchar telnet_cmd[64]{};
uint telnet_cmdlen = 0; uint telnet_cmdlen = 0;
uint telnet_cmds_received = 0; uint telnet_cmds_received = 0;
uint telnet_mode = 0; std::atomic<uint> telnet_mode = 0;
/* input_thread() writes to these variables: */ /* input_thread() writes to these variables: */
uchar telnet_last_rxch = 0; uchar telnet_last_rxch = 0;
char telnet_location[128]{}; char telnet_location[128]{};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment