mirror of
https://github.com/kunkundi/crossdesk-server.git
synced 2026-10-26 01:34:33 +08:00
[fix] reject empty identities when joining transmissions
This commit is contained in:
1 parent
a39e00e7a1
commit
7c6280c809
2 files changed
+4
-1
No files matched your search
@@ -391,7 +391,7 @@ bool SignalNegotiation::join_transmission(websocketpp::connection_hdl hdl,
|
||||
}
|
||||
|
||||
std::string user_id;
|
||||
if (!GetStringField(j, "user_id", user_id)) {
|
||||
if (!GetStringField(j, "user_id", user_id) || user_id.empty()) {
|
||||
LOG_ERROR("join_transmission missing or invalid field: user_id");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -252,6 +252,9 @@ bool TransmissionManager::BindHostToTransmission(
|
||||
bool TransmissionManager::BindGuestToTransmission(
|
||||
const std::string& guest_id, const std::string& transmission_id) {
|
||||
StateLock lock(*this);
|
||||
if (guest_id.empty() || transmission_id.empty()) {
|
||||
return false;
|
||||
}
|
||||
auto host_it = transmission_host_id_list_.find(transmission_id);
|
||||
if (host_it == transmission_host_id_list_.end()) {
|
||||
LOG_WARN("Transmission [{}] does not exist", transmission_id);
|
||||
|
||||
Reference in new issue
Block a user