Browse Source

Mitigation for data race

Paul-Louis Ageneau 4 years ago
parent
commit
de2ac6c0c2
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/sctptransport.cpp

+ 4 - 0
src/sctptransport.cpp

@@ -349,6 +349,10 @@ void SctpTransport::incoming(message_ptr message) {
 	}
 
 	PLOG_VERBOSE << "Incoming size=" << message->size();
+
+	// TODO: There seems to be a possible data race between usrsctp_sendv() and usrsctp_conninput()
+	// As a mitigation, lock the send mutex before calling usrsctp_conninput()
+	std::lock_guard lock(mSendMutex);
 	usrsctp_conninput(this, message->data(), message->size(), 0);
 }