[OpenSIPS-Devel] [OpenSIPS/opensips] 722547: presence: Fix subtle race condition in update_db_s...

Liviu Chircu noreply at github.com
Mon Jul 22 15:55:00 UTC 2024


  Branch: refs/heads/3.4
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 722547d431765c5bd7ec802e27ece19fadd81fa2
      https://github.com/OpenSIPS/opensips/commit/722547d431765c5bd7ec802e27ece19fadd81fa2
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2024-07-22 (Mon, 22 Jul 2024)

  Changed paths:
    M modules/presence/subscribe.c

  Log Message:
  -----------
  presence: Fix subtle race condition in update_db_subs()

While walking the list and collecting expired subscriptions, it is
incorrect to temporarily release, then re-acquire the lock and still
make use of the @s or @prev_s pointers afterwards, as the list may have
changed in the meantime!

The fix is to detach and collect any expired subs, then walk & handle
them in a separate iteration.

(cherry picked from commit b8e0250bc957bb408f23317012716524129f1fa9)



To unsubscribe from these emails, change your notification settings at https://github.com/OpenSIPS/opensips/settings/notifications



More information about the Devel mailing list