From: Linus Torvalds Date: Wed, 18 Nov 2009 21:31:52 +0000 (+0100) Subject: strcmp: fix overflow and possibly signedness error X-Git-Tag: v2.6.32-rc8~5 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a414f01ac2899f273ef8fe98fa44158ac12793f2;p=pandora-kernel.git 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 Cc: Michael Buesch Cc: Andreas Schwab Cc: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed