mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-10 00:58:20 +03:00
[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.
This commit is contained in:
parent
0bcdc8498c
commit
0536819cca
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user