linux/arch/s390/lib
Roberto Sassu 8e0ab8e26b s390: fix strrchr() implementation
Fix two problems found in the strrchr() implementation for s390
architectures: evaluate empty strings (return the string address instead of
NULL, if '\0' is passed as second argument); evaluate the first character
of non-empty strings (the current implementation stops at the second).

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Reported-by: Heiko Carstens <hca@linux.ibm.com> (incorrect behavior with empty strings)
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Link: https://lore.kernel.org/r/20211005120836.60630-1-roberto.sassu@huawei.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2021-10-12 13:07:37 +02:00
..
delay.c s390/delay: get rid of not needed header includes 2021-07-27 09:39:22 +02:00
error-inject.c s390: enable HAVE_FUNCTION_ERROR_INJECTION 2020-07-27 10:33:28 +02:00
find.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile s390: enable HAVE_FUNCTION_ERROR_INJECTION 2020-07-27 10:33:28 +02:00
mem.S s390: add missing ENDPROC statements to assembler functions 2019-05-02 13:54:11 +02:00
probes.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
spinlock.c s390/spinlock: remove confusing comment in arch_spin_lock_wait 2019-12-11 19:53:23 +01:00
string.c s390: fix strrchr() implementation 2021-10-12 13:07:37 +02:00
test_unwind.c s390/lib: use call_on_stack() macro 2021-07-08 22:12:18 +02:00
uaccess.c arch: remove compat_alloc_user_space 2021-09-08 15:32:35 -07:00
xor.c s390/lib,xor: get rid of register asm 2021-06-28 11:18:28 +02:00