[OpenSIPS-Devel] [OpenSIPS/opensips] a117dc: registrar: Fix possible crash in remove_ip_port()

Liviu Chircu noreply at github.com
Tue Feb 7 09:06:01 UTC 2023


  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: a117dc8dc5d9eab24d2bc646fb70e6afbaaced94
      https://github.com/OpenSIPS/opensips/commit/a117dc8dc5d9eab24d2bc646fb70e6afbaaced94
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2023-02-07 (Tue, 07 Feb 2023)

  Changed paths:
    M modules/registrar/save.c

  Log Message:
  -----------
  registrar: Fix possible crash in remove_ip_port()

The release_urecord() function may actually delete the AoR on the spot,
including the map_t node which the iterator is currently at!  This was
causing an invalid SHM memory read when calling iterator_next(),
potentially running into a crash.

The fix is to advance the iterator ahead of time, before the
release_urecord() call.

Fixes #2954





More information about the Devel mailing list