Linus Torvalds a414f01ac2 strcmp: fix overflow and possibly signedness error
Doing the strcmp return value as

	signed char __res = *cs - *ct;

is wrong for two reasons.  The subtraction can overflow because __res
doesn't use a type big enough.  Moreover the compared bytes should be
interpreted as unsigned char as specified by POSIX.

The same problem is fixed in strncmp.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Michael Buesch <mb@bu3sch.de>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-11-18 17:18:13 -08:00
..
2009-06-19 14:58:13 +02:00
2009-07-28 13:45:22 -07:00
2009-01-01 10:12:19 +10:30
2009-06-18 13:04:05 -07:00
2009-06-16 19:47:51 -07:00
2009-04-02 19:04:53 -07:00
2009-07-29 19:10:36 -07:00
2009-10-01 16:11:16 -07:00