From: hare@suse.de Date: Thu, 1 Apr 2004 06:56:45 +0000 (-0800) Subject: [PATCH] fix SEGV in libsysfs/dlist.c X-Git-Tag: 024~29 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0536819cca9468cf383807037dbaa5ad0d48b60f;p=systemd [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. --- 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);