linux/lib
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
..
lzo
reed_solomon
zlib_deflate trivial: fix typo "to to" in multiple files 2009-09-21 15:14:55 +02:00
zlib_inflate
.gitignore
argv_split.c
atomic64.c lib: export generic atomic64_t functions 2009-07-29 19:10:35 -07:00
audit.c
bcd.c
bitmap.c Make bitmask 'and' operators return a result code 2009-08-21 09:26:15 -07:00
bitrev.c
bug.c
bust_spinlocks.c
check_signature.c
checksum.c lib/checksum.c: fix endianess bug 2009-06-19 14:58:13 +02:00
cmdline.c
cpumask.c x86: remove some alloc_bootmem_cpumask_var calling 2009-06-11 19:27:07 +03:00
crc7.c
crc16.c
crc32.c
crc32defs.h
crc-ccitt.c
crc-itu-t.c
crc-t10dif.c
ctype.c
debug_locks.c
debugobjects.c headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
dec_and_lock.c atomic: only take lock when the counter drops to zero on UP as well 2009-06-16 19:47:47 -07:00
decompress_bunzip2.c lib/decompress_*: only include <linux/slab.h> if STATIC is not defined 2009-08-07 10:39:56 -07:00
decompress_inflate.c lzma/gzip: fix potential oops when input data is truncated 2009-09-24 07:21:05 -07:00
decompress_unlzma.c lzma/gzip: fix potential oops when input data is truncated 2009-09-24 07:21:05 -07:00
decompress.c
devres.c
div64.c
dma-debug.c dma-debug: Fix compile warning with PAE enabled 2009-10-29 16:25:50 +01:00
dump_stack.c
dynamic_debug.c Dynamic debug: fix typo: -/-> 2009-07-28 13:45:22 -07:00
extable.c module: trim exception table on init free. 2009-06-12 21:47:04 +09:30
fault-inject.c headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
find_last_bit.c
find_next_bit.c
flex_array.c flex_array: add missing kerneldoc annotations 2009-09-22 07:17:47 -07:00
gcd.c lib: add lib/gcd.c 2009-06-18 13:04:05 -07:00
gen_crc32table.c
genalloc.c lib/genalloc.c: remove unmatched write_lock() in gen_pool_destroy 2009-06-16 19:47:53 -07:00
halfmd4.c
hexdump.c hexdump: remove the trailing space 2009-06-16 19:47:51 -07:00
hweight.c
idr.c
inflate.c Nicolas Pitre has a new email address 2009-09-15 09:37:12 -07:00
int_sqrt.c
iomap_copy.c
iomap.c
iommu-helper.c
ioremap.c
irq_regs.c
is_single_threaded.c kernel: is_current_single_threaded: don't use ->mmap_sem 2009-07-17 09:11:31 +10:00
kasprintf.c
Kconfig lib: Provide generic atomic64_t implementation 2009-06-15 13:27:38 +10:00
Kconfig.debug powerpc: Minor cleanup to lib/Kconfig.debug 2009-10-27 16:42:42 +11:00
Kconfig.kgdb
Kconfig.kmemcheck kmemcheck: depend on HAVE_ARCH_KMEMCHECK 2009-07-01 22:28:44 +02:00
kernel_lock.c
klist.c
kobject_uevent.c
kobject.c kobject: make kset_create check kobject_set_name return value 2009-06-15 21:30:24 -07:00
kref.c
libcrc32c.c
list_debug.c
lmb.c lmb: Remove __init from lmb_end_of_DRAM() 2009-08-27 12:25:26 -07:00
locking-selftest-hardirq.h
locking-selftest-mutex.h
locking-selftest-rlock-hardirq.h
locking-selftest-rlock-softirq.h
locking-selftest-rlock.h
locking-selftest-rsem.h
locking-selftest-softirq.h
locking-selftest-spin-hardirq.h
locking-selftest-spin-softirq.h
locking-selftest-spin.h
locking-selftest-wlock-hardirq.h
locking-selftest-wlock-softirq.h
locking-selftest-wlock.h
locking-selftest-wsem.h
locking-selftest.c
Makefile lib: flexible array implementation 2009-07-29 19:10:36 -07:00
nlattr.c
parser.c
percpu_counter.c
plist.c
prio_heap.c
prio_tree.c
proportions.c
radix-tree.c lib: do code optimization for radix_tree_lookup() and radix_tree_lookup_slot() 2009-06-16 19:47:49 -07:00
random32.c
ratelimit.c
rational.c lib: isolate rational fractions helper function 2009-06-11 08:51:08 -07:00
rbtree.c rb_tree: remove redundant if()-condition in rb_erase() 2009-06-16 19:47:56 -07:00
reciprocal_div.c
rwsem-spinlock.c
rwsem.c
scatterlist.c lib/scatterlist: add a flags to signalize mapping direction 2009-07-31 12:28:45 +02:00
sha1.c
show_mem.c
smp_processor_id.c
sort.c
spinlock_debug.c
string_helpers.c
string.c strcmp: fix overflow and possibly signedness error 2009-11-18 17:18:13 -08:00
swiotlb.c lib/swiotlb.c: Fix strange panic message selection logic when swiotlb fills up 2009-08-21 10:36:03 +02:00
syscall.c
textsearch.c
ts_bm.c
ts_fsm.c
ts_kmp.c
vsprintf.c sscanf(): fix %*s%n 2009-10-01 16:11:16 -07:00