linux/drivers/video/fbdev/core
Dan Carpenter 78482af095 video: fbdev: fbcvt.c: fix printing in fb_cvt_print_name()
This code has two bugs:
1) "cnt" is 255 but the size of the buffer is 256 so the last byte is
   not used.
2) If we try to print more than 255 characters then "cnt" will be
   negative and that will trigger a WARN() in snprintf(). The fix for
   this is to use scnprintf() instead of snprintf().

We can re-write this code to be cleaner:
1) Rename "offset" to "off" because that's shorter.
2) Get rid of the "cnt" variable and just use "size - off" directly.
3) Get rid of the "read" variable and just increment "off" directly.

Fixes: 96fe6a2109 ("fbdev: Add VESA Coordinated Video Timings (CVT) support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Helge Deller <deller@gmx.de>
2022-01-30 21:19:22 +01:00
..
bitblit.c fbdev: Garbage collect fbdev scrolling acceleration, part 1 (from TODO list) 2021-10-13 15:29:23 +02:00
cfbcopyarea.c
cfbfillrect.c
cfbimgblt.c
fb_cmdline.c video/fbdev: refactor video= cmdline parsing 2019-02-08 19:24:47 +01:00
fb_ddc.c
fb_defio.c Revert "fb_defio: Remove custom address_space_operations" 2021-06-01 17:38:40 +02:00
fb_draw.h
fb_notify.c video: fbdev: core: Fix kernel-doc warnings in fbmon + fb_notify 2020-12-08 18:31:56 +01:00
fb_sys_fops.c
fbcmap.c fbdev: zero-fill colormap in fbcmap.c 2021-04-10 11:12:08 +02:00
fbcon_ccw.c fbdev: Garbage collect fbdev scrolling acceleration, part 1 (from TODO list) 2021-10-13 15:29:23 +02:00
fbcon_cw.c fbdev: Garbage collect fbdev scrolling acceleration, part 1 (from TODO list) 2021-10-13 15:29:23 +02:00
fbcon_rotate.c fbcon: Drop EXPORT_SYMBOL 2020-11-17 11:00:43 +01:00
fbcon_rotate.h fbdev: Garbage collect fbdev scrolling acceleration, part 1 (from TODO list) 2021-10-13 15:29:23 +02:00
fbcon_ud.c fbdev: Garbage collect fbdev scrolling acceleration, part 1 (from TODO list) 2021-10-13 15:29:23 +02:00
fbcon.c fbdev: Garbage collect fbdev scrolling acceleration, part 1 (from TODO list) 2021-10-13 15:29:23 +02:00
fbcon.h fbdev: Garbage collect fbdev scrolling acceleration, part 1 (from TODO list) 2021-10-13 15:29:23 +02:00
fbcvt.c video: fbdev: fbcvt.c: fix printing in fb_cvt_print_name() 2022-01-30 21:19:22 +01:00
fbmem.c video: fbmem: use swap() to make code cleaner in fb_rotate_logo() 2022-01-29 23:42:20 +01:00
fbmon.c video: fbdev: core: Fix kernel-doc warnings in fbmon + fb_notify 2020-12-08 18:31:56 +01:00
fbsysfs.c video: fbdev: replace snprintf in show functions with sysfs_emit 2021-10-15 22:46:16 +02:00
Makefile fbdev: remove object duplication in Makefile 2020-01-15 17:31:52 +01:00
modedb.c fbdev: Ditch fb_edid_add_monspecs 2019-07-23 14:17:22 +02:00
softcursor.c fbcon: Drop EXPORT_SYMBOL 2020-11-17 11:00:43 +01:00
svgalib.c
syscopyarea.c
sysfillrect.c
sysimgblt.c
tileblit.c fbdev: Garbage collect fbdev scrolling acceleration, part 1 (from TODO list) 2021-10-13 15:29:23 +02:00