From 0536819cca9468cf383807037dbaa5ad0d48b60f Mon Sep 17 00:00:00 2001 From: "hare@suse.de" Date: Wed, 31 Mar 2004 22:56:45 -0800 Subject: [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(-) (limited to 'libsysfs/dlist.c') diff --git a/libsysfs/dlist.c b/libsysfs/dlist.c index 942eccb48c..b440d65bed 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); -- cgit v1.2.3-54-g00ecf