浏览代码

ims_charging: check if the session to be linked is actually part of list

- issue reported and patch suggested by GH #1549
Daniel-Constantin Mierla 7 年之前
父节点
当前提交
f42e5420f5
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/modules/ims_charging/ro_session_hash.h

+ 7 - 0
src/modules/ims_charging/ro_session_hash.h

@@ -158,6 +158,13 @@ extern struct ro_session_table *ro_session_table;
  * \param ro_session unlinked ro_session
  */
 static inline void unlink_unsafe_ro_session(struct ro_session_entry *ro_session_entry, struct ro_session *ro_session) {
+	if ((ro_session->next == 0x00) &&
+			(ro_session->prev == 0x00) &&
+			(ro_session != ro_session_entry->first) )
+	{
+		return;
+	}
+
     if (ro_session->next)
         ro_session->next->prev = ro_session->prev;
     else