1
0
Fork 0
alistair23-linux/drivers/staging/fbtft
Andy Shevchenko 88540bc176 fbtft: Make sure string is NULL terminated
[ Upstream commit 21f585480d ]

New GCC warns about inappropriate use of strncpy():

drivers/staging/fbtft/fbtft-core.c: In function ‘fbtft_framebuffer_alloc’:
drivers/staging/fbtft/fbtft-core.c:665:2: warning: ‘strncpy’ specified bound 16 equals destination size [-Wstringop-truncation]
  665 |  strncpy(info->fix.id, dev->driver->name, 16);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Later on the copy is being used with the assumption to be NULL terminated.
Make sure string is NULL terminated by switching to snprintf().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20191120095716.26628-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-31 16:45:42 +01:00
..
Kconfig staging/fbtft: Remove flexfb 2019-10-01 08:22:44 +02:00
Makefile staging/fbtft: Remove flexfb 2019-10-01 08:22:44 +02:00
README
TODO staging/fbtft: Update TODO and mailing lists 2018-09-10 10:39:19 +02:00
fb_agm1264k-fl.c staging: fbtft: fb_agm1264k-fl.c: Replace bit shifting with BIT macro 2019-04-02 19:57:11 +02:00
fb_bd663474.c Staging: fbtft: Fix GPIO handling 2019-07-25 10:09:29 +02:00
fb_hx8340bn.c staging: fbtft: make several arrays static const, makes object smaller 2019-09-12 10:35:52 +01:00
fb_hx8347d.c staging: fbtft: make several arrays static const, makes object smaller 2019-09-12 10:35:52 +01:00
fb_hx8353d.c staging: fbtft: remove redundant license text 2018-01-15 16:03:46 +01:00
fb_hx8357d.c staging: fbtft: remove redundant license text 2018-01-15 16:03:46 +01:00
fb_hx8357d.h staging: fbtft: add SPDX identifiers 2018-01-15 16:03:46 +01:00
fb_ili9163.c staging: fbtft: make several arrays static const, makes object smaller 2019-09-12 10:35:52 +01:00
fb_ili9320.c staging: fbtft: make several arrays static const, makes object smaller 2019-09-12 10:35:52 +01:00
fb_ili9325.c staging: fbtft: make several arrays static const, makes object smaller 2019-09-12 10:35:52 +01:00
fb_ili9340.c Staging: fbtft: Switch to the gpio descriptor interface 2019-01-18 11:01:02 +01:00
fb_ili9341.c staging: fbtft: Puts macro arguments in parenthesis to avoid precedence issues - Style 2018-08-08 14:23:16 +02:00
fb_ili9481.c staging: fbtft: remove redundant license text 2018-01-15 16:03:46 +01:00
fb_ili9486.c staging: fbtft: remove redundant license text 2018-01-15 16:03:46 +01:00
fb_pcd8544.c Staging: fbtft: Fix some typo. pdc8544 --> pcd8544 2019-07-30 09:52:04 +02:00
fb_ra8875.c staging: fbtft: fixed format-string errors. 2019-03-18 07:06:08 +01:00
fb_s6d02a1.c staging: fbtft: Adjust some empty-line problems - Style 2018-08-08 14:23:16 +02:00
fb_s6d1121.c staging: fbtft: make several arrays static const, makes object smaller 2019-09-12 10:35:52 +01:00
fb_sh1106.c Staging: fbtft: Switch to the gpio descriptor interface 2019-01-18 11:01:02 +01:00
fb_ssd1289.c staging: fbtft: make several arrays static const, makes object smaller 2019-09-12 10:35:52 +01:00
fb_ssd1305.c Staging: fbtft: Switch to the gpio descriptor interface 2019-01-18 11:01:02 +01:00
fb_ssd1306.c staging: fbtft: ternary statement to if statement. 2019-03-19 14:35:42 +01:00
fb_ssd1325.c Staging: fbtft: Switch to the gpio descriptor interface 2019-01-18 11:01:02 +01:00
fb_ssd1331.c Staging: fbtft: Fix GPIO handling 2019-07-25 10:09:29 +02:00
fb_ssd1351.c staging: fbtft: fb_ssd1351.c: Replace bit shifting with BIT macro 2019-04-02 19:57:11 +02:00
fb_st7735r.c staging: fbtft: Fixes some alignment issues - Style 2018-08-08 14:23:16 +02:00
fb_st7789v.c staging: fbtft: Fixes some alignment issues - Style 2018-08-08 14:23:16 +02:00
fb_tinylcd.c Staging: fbtft: Alignment should match open parenthesis 2019-02-26 11:40:07 +01:00
fb_tls8204.c Staging: fbtft: Switch to the gpio descriptor interface 2019-01-18 11:01:02 +01:00
fb_uc1611.c Staging: fbtft: Switch to the gpio descriptor interface 2019-01-18 11:01:02 +01:00
fb_uc1701.c Staging: fbtft: Switch to the gpio descriptor interface 2019-01-18 11:01:02 +01:00
fb_upd161704.c Staging: fbtft: Fix GPIO handling 2019-07-25 10:09:29 +02:00
fb_watterott.c staging: fbtft: convert a macro to a function. 2019-03-18 07:05:22 +01:00
fbtft-bus.c Staging: fbtft: Fix GPIO handling 2019-07-25 10:09:29 +02:00
fbtft-core.c fbtft: Make sure string is NULL terminated 2019-12-31 16:45:42 +01:00
fbtft-io.c staging: fbtft: fixed format-string errors. 2019-03-18 07:06:08 +01:00
fbtft-sysfs.c staging: fbtft: Fixes some alignment issues - Style 2018-08-08 14:23:16 +02:00
fbtft.h staging: fbtft: fixed format-string errors. 2019-03-18 07:06:08 +01:00
internal.h staging: fbtft: remove redundant license text 2018-01-15 16:03:46 +01:00

README

  FBTFT
=========

Linux Framebuffer drivers for small TFT LCD display modules.
The module 'fbtft' makes writing drivers for some of these displays very easy.

Development is done on a Raspberry Pi running the Raspbian "wheezy" distribution.

INSTALLATION
  Download kernel sources

  From Linux 3.15
    cd drivers/video/fbdev/fbtft
    git clone https://github.com/notro/fbtft.git

    Add to drivers/video/fbdev/Kconfig:   source "drivers/video/fbdev/fbtft/Kconfig"
    Add to drivers/video/fbdev/Makefile:  obj-y += fbtft/

  Before Linux 3.15
    cd drivers/video
    git clone https://github.com/notro/fbtft.git

    Add to drivers/video/Kconfig:   source "drivers/video/fbtft/Kconfig"
    Add to drivers/video/Makefile:  obj-y += fbtft/

  Enable driver(s) in menuconfig and build the kernel


See wiki for more information: https://github.com/notro/fbtft/wiki


Source: https://github.com/notro/fbtft/