Skip to contentSkip to conversation

Trivial fix to phram.c

PATCH In review Ari Rahikkala 3 participants 7 messages Aug 4, 2004 – Aug 5, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Trivial fix to phram.c

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);
drivers/mtd/devices/phram.c.argument_fix renamed from drivers/mtd/devices/phram.c +3 -2
@@ -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);
#1 lore raw
Quoted 3 lines · Ari Rahikkala

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?

Quoted 12 lines

--- 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
drivers/mtd/devices/phram.c.argument_fix renamed from drivers/mtd/devices/phram.c +2 -1
@@ -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];

drivers/mtd/devices/phram.c.argument_fix line 245

Quoted 10 lines
drivers/mtd/devices/phram.c.argument_fix renamed from drivers/mtd/devices/phram.c +1 -1
        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

Signature · 4 lines
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
#2 lore raw
Quoted 6 lines · Jörn Engel
Quoted 3 lines · Ari Rahikkala

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?

Not yet. Does anyone still not have IPv6? :)

Signature · 1 line
dwmw2
#3 lore raw
Quoted 2 lines · David Woodhouse

Not yet. Does anyone still not have IPv6? :)

Does it involve work to set things up? ;)

Jörn

Signature · 3 lines
The wise man seeks everything in himself; the ignorant man tries to get
everything from somebody else.
-- unknown
#4 lore raw
Quoted 5 lines · Jörn Engel
Quoted 2 lines · David Woodhouse

Not yet. Does anyone still not have IPv6? :)

Does it involve work to set things up? ;)

Yeah. Four lines added to your network config scripts.
http://www.linux-mtd.infradead.org/

Signature · 1 line
dwmw2
#5 lore raw
Quoted 6 lines · David Woodhouse
Quoted 2 lines · Jörn Engel

Does it involve work to set things up? ;)

Yeah. Four lines added to your network config scripts.
http://www.linux-mtd.infradead.org/

o Debian
o Company firewall
o No internet at home (I'm a cheap and lazy bastard)

Fsck!

Jörn

Signature · 2 lines
The only real mistake is the one from which we learn nothing.
-- John Powell
#6 lore raw
Quoted 11 lines · Jörn Engel
Quoted 6 lines · David Woodhouse
Quoted 2 lines · Jörn Engel

Does it involve work to set things up? ;)

Yeah. Four lines added to your network config scripts.
http://www.linux-mtd.infradead.org/

o Debian
o Company firewall
o No internet at home (I'm a cheap and lazy bastard)

SSH's ProxyCommand option is a wonderful thing.

Host cvs.infradead.org
ProxyCommand ssh <someipv6capablebox> exec netcat %h %p

Signature · 1 line
dwmw2