All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] SEGV in libsysfs/dlist.c
Date: Thu, 18 Mar 2004 12:15:35 +0000	[thread overview]
Message-ID: <405992E7.3070105@suse.de> (raw)

[-- 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);

             reply	other threads:[~2004-03-18 12:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-18 12:15 Hannes Reinecke [this message]
2004-03-24 23:15 ` [PATCH] SEGV in libsysfs/dlist.c Greg KH
2004-03-25  4:32 ` Ananth N Mavinakayanahalli
2004-03-31 22:58 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=405992E7.3070105@suse.de \
    --to=hare@suse.de \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.