[PATCH] Trivial fix to phram.c

Jörn Engel joern at wohnheim.fh-wedel.de
Thu Aug 5 08:52:50 EDT 2004


On Wed, 4 August 2004 22:41:32 +0300, Ari Rahikkala wrote:
> 
> I'm not sure if gmail likes to mangle stuff a lot, so I'll include
> this patch both inline and as an attachment.

Patch is fine.  David, does cvs via ipv4 work again?

> --- linux-2.6.7/drivers/mtd/devices/phram.c     2004-08-04
> 22:29:04.850552576 +0300
> +++ linux-2.6.7/drivers/mtd/devices/phram.c.argument_fix       
> 2004-08-04 22:25:04.557082736 +0300
> @@ -231,14 +231,15 @@
>  
>  static int phram_setup(const char *val, struct kernel_param *kp)
>  {
> -       char buf[64+12+12], *str = buf;
> +       const int buflen = 88;
> +       char buf[buflen], *str = buf;
>         char *token[3];
>         char *name;
>         uint32_t start;
>         uint32_t len;
>         int i, ret;
>  
> -       if (strnlen(val, sizeof(str)) >= sizeof(str))
> +       if (strnlen(val, buflen) >= buflen)
>                 parse_err("parameter too long\n");
>  
>         strcpy(str, val);


Jörn

-- 
My second remark is that our intellectual powers are rather geared to
master static relations and that our powers to visualize processes
evolving in time are relatively poorly developed.
-- Edsger W. Dijkstra




More information about the linux-mtd mailing list