v0.7.15 - Fixed race condition in subscription management causing intermittent core dumps and format truncation warning

This commit is contained in:
Your Name
2025-10-14 11:34:55 -04:00
parent 670329700c
commit 29680f0ee8
8 changed files with 77 additions and 53 deletions

View File

@@ -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;
}