Re: [PATCH, v2] isdn: Fix stack corruption in isdnloop_init()

From: Arjan van de Ven
Date: Wed Sep 02 2009 - 09:11:41 EST


On Wed, 2 Sep 2009 15:03:36 +0200
Ingo Molnar <mingo@xxxxxxx> wrote:

>
> [ v2: use strlen instead of sizeof. ]
>
> diff --git a/drivers/isdn/isdnloop/isdnloop.c
> b/drivers/isdn/isdnloop/isdnloop.c index a335c85..0c8d8cb 100644
> --- a/drivers/isdn/isdnloop/isdnloop.c
> +++ b/drivers/isdn/isdnloop/isdnloop.c
> @@ -1494,7 +1494,7 @@ static int __init
> isdnloop_init(void)
> {
> char *p;
> - char rev[10];
> + char rev[strlen(revision)+1];
>
> if ((p = strchr(revision, ':'))) {
> strcpy(rev, p + 1);

now it;s a runtime variable sized array.
NotNice(tm)


--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/