linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] SEGV in libsysfs/dlist.c
@ 2004-03-18 12:15 Hannes Reinecke
  2004-03-24 23:15 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hannes Reinecke @ 2004-03-18 12:15 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 346 bytes --]

Hi all, Greg,

libsysfs/dlist.c: _dlist_mark_move()

is missing checks for empty lists and may (and indeed, does) crash when 
called with empty dlists.

Please apply.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke			hare@suse.de
SuSE Linux AG				S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de

[-- Attachment #2: libsysfs-dlist.patch --]
[-- Type: text/plain, Size: 503 bytes --]

===== dlist.c 1.3 vs edited =====
--- 1.3/libsysfs/dlist.c	Wed Mar 10 18:12:14 2004
+++ edited/dlist.c	Thu Mar 18 13:11:00 2004
@@ -74,14 +74,14 @@
 {
   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);

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-03-31 22:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-18 12:15 [PATCH] SEGV in libsysfs/dlist.c Hannes Reinecke
2004-03-24 23:15 ` Greg KH
2004-03-25  4:32 ` Ananth N Mavinakayanahalli
2004-03-31 22:58 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).