Module: kamailio
Branch: 5.0
Commit: 889ff59366b1c550eb35bb222dcc5dd57881357d
URL:
https://github.com/kamailio/kamailio/commit/889ff59366b1c550eb35bb222dcc5dd…
Author: Vitaliy Aleksandrov <vitalik.voip(a)gmail.com>
Committer: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Date: 2017-11-07T13:09:08+01:00
tsilo: fix internal data structures
- avoid crash by fixing "first" and "last" pointers of of the
ts_entry_t after ts_urecord_t deletion
(cherry picked from commit cf26bbe33307067141dc1abb21fb7c53cb0e5ecc)
---
Modified: src/modules/tsilo/ts_hash.c
---
Diff:
https://github.com/kamailio/kamailio/commit/889ff59366b1c550eb35bb222dcc5dd…
Patch:
https://github.com/kamailio/kamailio/commit/889ff59366b1c550eb35bb222dcc5dd…
---
diff --git a/src/modules/tsilo/ts_hash.c b/src/modules/tsilo/ts_hash.c
index 01d79940eb..fec10431ca 100644
--- a/src/modules/tsilo/ts_hash.c
+++ b/src/modules/tsilo/ts_hash.c
@@ -280,10 +280,10 @@ void remove_ts_urecord(ts_urecord_t* _r)
if (_r->next)
_r->next->prev = _r->prev;
- /* it was the last urecord */
- if (entry->n == 1) {
- entry->first = entry->last = NULL;
- }
+ if (entry->first == _r)
+ entry->first = _r->next;
+ if (entry->last == _r)
+ entry->last = _r->prev;
update_stat(stored_ruris, -1);