v0.7.15 - Fixed race condition in subscription management causing intermittent core dumps and format truncation warning
This commit is contained in:
@@ -622,7 +622,8 @@ int broadcast_event_to_subscriptions(cJSON* event) {
|
||||
subscription_t* update_sub = g_subscription_manager.active_subscriptions;
|
||||
while (update_sub) {
|
||||
if (update_sub->wsi == current_temp->wsi &&
|
||||
strcmp(update_sub->id, current_temp->id) == 0) {
|
||||
strcmp(update_sub->id, current_temp->id) == 0 &&
|
||||
update_sub->active) { // Add active check to prevent use-after-free
|
||||
update_sub->events_sent++;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user