Module: kamailio
Branch: master
Commit: 80beb29ac0204697a8964231b441ac37866a4a1c
URL:
https://github.com/kamailio/kamailio/commit/80beb29ac0204697a8964231b441ac3…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-04-09T17:18:54+02:00
dialog: safety check for prev field
---
Modified: src/modules/dialog/dlg_timer.c
---
Diff:
https://github.com/kamailio/kamailio/commit/80beb29ac0204697a8964231b441ac3…
Patch:
https://github.com/kamailio/kamailio/commit/80beb29ac0204697a8964231b441ac3…
---
diff --git a/src/modules/dialog/dlg_timer.c b/src/modules/dialog/dlg_timer.c
index 0ac13df25c..6b84a4d68c 100644
--- a/src/modules/dialog/dlg_timer.c
+++ b/src/modules/dialog/dlg_timer.c
@@ -222,7 +222,7 @@ static inline struct dlg_tl* get_expired_dlgs(unsigned int time)
lock_get( d_timer->lock);
if (d_timer->first.next==&(d_timer->first)
- || d_timer->first.next->timeout > time ) {
+ || d_timer->first.next->timeout > time ) {
lock_release( d_timer->lock);
return 0;
}
@@ -247,7 +247,9 @@ static inline struct dlg_tl* get_expired_dlgs(unsigned int time)
ret = 0;
} else {
ret = d_timer->first.next;
- tl->prev->next = 0;
+ if(tl->prev) {
+ tl->prev->next = 0;
+ }
d_timer->first.next = tl;
tl->prev = &d_timer->first;
}