All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Green <andy@warmcat.com>
To: lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] scripts/basic/fixdep segfault on pathological string-o-death
Date: Wed, 02 May 2007 12:49:06 +0100	[thread overview]
Message-ID: <46387AB2.1090800@warmcat.com> (raw)

build scripts: fixdep blows segfault on string CONFIG_MODULE seen

The string "CONFIG_MODULE" appearing anywhere in a source file causes
fixdep to segfault.  This string appeared in the wild in the current
mISDN sources (I think they meant CONFIG_MODULES).  But it shouldn't
segfault (esp as CONFIG_MODULE appeared in a quoted string).

Signed-off-by: Andy Green <andy@warmcat.com>
---
 scripts/basic/fixdep.c |    2 ++
 1 file changed, 2 insertions(+)

Index: 2.6.21-1.3116.fc7-i686/scripts/basic/fixdep.c
===================================================================
--- 2.6.21-1.3116.fc7-i686.orig/scripts/basic/fixdep.c
+++ 2.6.21-1.3116.fc7-i686/scripts/basic/fixdep.c
@@ -249,6 +249,8 @@ void parse_config_file(char *map, size_t
 	found:
 		if (!memcmp(q - 7, "_MODULE", 7))
 			q -= 7;
+		if( (q-p-7) < 0 )
+			continue;
 		use_config(p+7, q-p-7);
 	}
 }

             reply	other threads:[~2007-05-02 11:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-02 11:49 Andy Green [this message]
2007-05-02 19:37 ` [PATCH] scripts/basic/fixdep segfault on pathological string-o-death Sam Ravnborg

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=46387AB2.1090800@warmcat.com \
    --to=andy@warmcat.com \
    --cc=linux-kernel@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.