[PATCH] Trivial fix to phram.c
Ari Rahikkala
ari.rahikkala at gmail.com
Wed Aug 4 15:41:32 EDT 2004
I'm not sure if gmail likes to mangle stuff a lot, so I'll include
this patch both inline and as an attachment.
--- 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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: argumentfix.diff
Type: text/x-patch
Size: 585 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-mtd/attachments/20040804/43fc674e/attachment.bin
More information about the linux-mtd
mailing list