aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/keyctl.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-11-18 22:31:52 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2009-11-18 17:18:13 -0800
commita414f01ac2899f273ef8fe98fa44158ac12793f2 (patch)
tree30a7ef8d7d2f8d4aca0781fa8785630fc1f6320d /security/keys/keyctl.c
parentMerge branch 'agp-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6 (diff)
downloadlinux-dev-a414f01ac2899f273ef8fe98fa44158ac12793f2.tar.xz
linux-dev-a414f01ac2899f273ef8fe98fa44158ac12793f2.zip
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>
Diffstat (limited to 'security/keys/keyctl.c')
0 files changed, 0 insertions, 0 deletions