From c7ed62fb928c3ba26ed78acf42f04dbb68851310 Mon Sep 17 00:00:00 2001 From: barbieri Date: Tue, 14 Jul 2009 14:00:59 +0000 Subject: [PATCH] one more safety check: do not remove element if it's not in any list. This is the best we can do, but what should be done is to check if element is really from that list. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@41326 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/eina_inlist.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/eina_inlist.c b/src/lib/eina_inlist.c index c9fd58f..488b3e0 100644 --- a/src/lib/eina_inlist.c +++ b/src/lib/eina_inlist.c @@ -251,6 +251,8 @@ eina_inlist_remove(Eina_Inlist *list, Eina_Inlist *item) /* checkme */ EINA_SAFETY_ON_NULL_RETURN_VAL(list, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(item, list); + EINA_SAFETY_ON_TRUE_RETURN_VAL + ((item != list) && (item->prev == NULL) && (item->next == NULL), list); if (item->next) item->next->prev = item->prev; -- 2.7.4