[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070624160014.84e26d35.akpm@linux-foundation.org>
Date: Sun, 24 Jun 2007 16:00:14 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: "Jesper Juhl" <jesper.juhl@...il.com>
Cc: "Richard Henderson" <rth@...u.edu>,
"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Avoid potential NULL deref in scripts/genksyms/lex.l
On Mon, 25 Jun 2007 00:02:03 +0200 "Jesper Juhl" <jesper.juhl@...il.com> wrote:
> > > + if (!file || !e)
> > > + exit(1);
> > > *e = '\0';
> > > cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1);
> > > cur_line = atoi(yytext+2);
> >
> > I don't think the bug which you're fixing can occur:
> >
> > ^#[ \t]+{INT}[ \t]+\"[^\"\n]+\".*\n return FILENAME;
> >
> > has anyone reported crashes in there?
> >
>
> It may indeed not be possible. Found by inspection, not by any actual
> observed crashes.
> But does it really hurt to be defensive here? In case it can somehow
> be caused to fail, with my patch it'll fail a bit nicer :) It's not
> like it's at all speed critical code that will be hurt by that extra
> 'if'...
We can only get NULL pointers here if the regexp is wrong or if there's
a bug in the regexp parser. Getting a coredump at the failure site is
much better behaviour than mysteriously exiting.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists