From 0536819cca9468cf383807037dbaa5ad0d48b60f Mon Sep 17 00:00:00 2001 From: "hare@suse.de" Date: Wed, 31 Mar 2004 22:56:45 -0800 Subject: [PATCH] [PATCH] fix SEGV in libsysfs/dlist.c Hi all, Greg, libsysfs/dlist.c: _dlist_mark_move() is missing checks for empty lists and may (and indeed, does) crash when=20 called with empty dlists. --- libsysfs/dlist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsysfs/dlist.c b/libsysfs/dlist.c index 942eccb4..b440d65b 100644 --- a/libsysfs/dlist.c +++ b/libsysfs/dlist.c @@ -74,14 +74,14 @@ inline void *_dlist_mark_move(Dlist *list,int direction) { if(direction) { - if( list->marker->next!=NULL) + if( list->marker && list->marker->next!=NULL) list->marker=list->marker->next; else return(NULL); } else { - if( list->marker->prev!=NULL) + if( list->marker && list->marker->prev!=NULL) list->marker=list->marker->prev; else return(NULL); -- 2.39.5