[pacman-dev] [PATCH 3/5] alpm_list : fix a bug in alpm_list_remove

Xavier Chantry shiningxc at gmail.com
Sat Oct 10 21:09:57 EDT 2009


A NULL list element triggered an infinite loop. Not cool :)

Signed-off-by: Xavier Chantry <shiningxc at gmail.com>
---
 lib/libalpm/alpm_list.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/libalpm/alpm_list.c b/lib/libalpm/alpm_list.c
index 8b2c7b3..127f72a 100644
--- a/lib/libalpm/alpm_list.c
+++ b/lib/libalpm/alpm_list.c
@@ -309,6 +309,7 @@ alpm_list_t SYMEXPORT *alpm_list_remove(alpm_list_t *haystack, const void *needl
 
 	while(i) {
 		if(i->data == NULL) {
+			i = i->next;
 			continue;
 		}
 		tmp = i->next;
-- 
1.6.4.4



More information about the pacman-dev mailing list