linux/drivers/misc/c2port
Lee Jones b23d5151f3 misc: c2port: core: Ensure source size does not equal destination size in strncpy()
We need to ensure there's a place for the NULL terminator.

Fixes the following W=1 warning(s):

 In file included from include/linux/bitmap.h:9,
 from include/linux/nodemask.h:95,
 from include/linux/mmzone.h:17,
 from include/linux/gfp.h:6,
 from include/linux/umh.h:4,
 from include/linux/kmod.h:9,
 from include/linux/module.h:16,
 from drivers/misc/c2port/core.c:9:
 In function ‘strncpy’,
 inlined from ‘c2port_device_register’ at drivers/misc/c2port/core.c:926:2:
 include/linux/string.h:297:30: warning: ‘__builtin_strncpy’ specified bound 32 equals destination size [-Wstringop-truncation]
 297 | #define __underlying_strncpy __builtin_strncpy
 | ^
 include/linux/string.h:307:9: note: in expansion of macro ‘__underlying_strncpy’
 307 | return __underlying_strncpy(p, q, size);
 | ^~~~~~~~~~~~~~~~~~~~

Cc: Rodolfo Giometti <giometti@linux.it>
Cc: "Eurotech S.p.A" <info@eurotech.it>
Acked-by: Rodolfo Giometti <giometti@enneenne.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20200626130525.389469-2-lee.jones@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-29 18:45:52 +02:00
..
c2port-duramar2150.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
core.c misc: c2port: core: Ensure source size does not equal destination size in strncpy() 2020-06-29 18:45:52 +02:00
Kconfig Merge 5.2-rc4 into char-misc-next 2019-06-09 09:11:21 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00