summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormananth <mananth>2004-03-19 09:40:35 +0000
committermananth <mananth>2004-03-19 09:40:35 +0000
commitd8172dc226b7fd33d655d7c28f63f89c0e2c9070 (patch)
tree937f3de1f2637ba79e6b267e1adee2f70cac7a6a
parent8d6a55f3048d415b621436b54018ee1f41cfbe94 (diff)
downloadsysfsutils-d8172dc226b7fd33d655d7c28f63f89c0e2c9070.tar.gz
Fix SEGV in dlist.c - patch by Dr. Hans Reinecke
-rw-r--r--ChangeLog3
-rw-r--r--lib/dlist.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8d97dda..7420c4d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
+03/19/2004 - Dr. Hannes Reinecke <hare@suse.de>
+ * Fixed SEGV in dlist.c
+
03/15/2004 - Ananth Mavinakayanahalli <ananth@in.ibm.com>
* Updated docs/libsysfs.txt for release 1.1.0
diff --git a/lib/dlist.c b/lib/dlist.c
index c6b104c..a324624 100644
--- a/lib/dlist.c
+++ b/lib/dlist.c
@@ -73,14 +73,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);