Martin & others:
I didn't see this posted before. Sorry if I missed it.
It's a harmless buglet which causes false positives with correctness
checking tools, and so annoys me.
Cheers,
-- Pete
--- linux-2.5.69-bk12/arch/s390/kernel/setup.c 2003-05-11 12:56:15.000000000 -0700
+++ linux-2.5.69-bk12-s390/arch/s390/kernel/setup.c 2003-05-28 13:01:54.000000000 -0700
@@ -165,15 +165,15 @@
static int __init conmode_setup(char *str)
{
#if defined(CONFIG_SCLP_CONSOLE)
- if (strncmp(str, "hwc", 4) == 0 || strncmp(str, "sclp", 5) == 0)
+ if (strncmp(str, "hwc", 3) == 0 || strncmp(str, "sclp", 4) == 0)
SET_CONSOLE_SCLP;
#endif
#if defined(CONFIG_TN3215_CONSOLE)
- if (strncmp(str, "3215", 5) == 0)
+ if (strncmp(str, "3215", 4) == 0)
SET_CONSOLE_3215;
#endif
#if defined(CONFIG_TN3270_CONSOLE)
- if (strncmp(str, "3270", 5) == 0)
+ if (strncmp(str, "3270", 4) == 0)
SET_CONSOLE_3270;
#endif
return 1;
On Wed, 28 May 2003, Pete Zaitcev wrote:
> Martin & others:
>
> I didn't see this posted before. Sorry if I missed it.
> It's a harmless buglet which causes false positives with correctness
> checking tools, and so annoys me.
>
> Cheers,
> -- Pete
Maybe it should be changed to memcmp() with the null-byte included
in the length since the compare length is already defined in the code.
This should reduce the overhead at the same time it gets rid
of the false positive.
[SNIPPED...]
Cheers,
Dick Johnson
Penguin : Linux version 2.4.20 on an i686 machine (797.90 BogoMips).
Why is the government concerned about the lunatic fringe? Think about it.
This one is different from the one in setup.c, being an actual bug.
-- Pete
--- linux-2.4.20-1.1931.2.199.z0/drivers/s390/char/sclp_tty.c 2003-05-19 17:16:59.000000000 -0400
+++ linux-2.4.20-1.1931.2.199.z1/drivers/s390/char/sclp_tty.c 2003-05-28 12:40:01.000000000 -0400
@@ -500,7 +500,7 @@
memcpy(sclp_tty->flip.char_buf_ptr, buf, count);
if (count < 2 ||
(strncmp ((const char *) buf + count - 2, "^n", 2) &&
- strncmp ((const char *) buf + count - 2, "\0252n", 2))) {
+ strncmp ((const char *) buf + count - 2, "\252n", 2))) {
sclp_tty->flip.char_buf_ptr[count] = '\n';
count++;
} else
On Wed, May 28, 2003 at 04:20:19PM -0400, Pete Zaitcev wrote:
> I didn't see this posted before. Sorry if I missed it.
> It's a harmless buglet which causes false positives with correctness
> checking tools, and so annoys me.
Are you sure it's harmless? Your patch changes the meaning from an
exact match to a prefix match. I think it's intended to be an exact
match, but I don't know why it doesn't just use strcmp().
Richard Braakman
>> I didn't see this posted before. Sorry if I missed it.
>> It's a harmless buglet which causes false positives with correctness
>> checking tools, and so annoys me.
>
> Are you sure it's harmless? Your patch changes the meaning from an
> exact match to a prefix match. I think it's intended to be an exact
> match, but I don't know why it doesn't just use strcmp().
The buglet is harmless. Now, the fix perhaps not.
I think it may be better to replace it with strcmp, too.
-- Pete