All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: fbtbt:  show() methods should use scnprintf()
@ 2015-09-29 19:15 Ksenija Stanojevic
  2015-09-29 19:38 ` [Outreachy kernel] " Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Ksenija Stanojevic @ 2015-09-29 19:15 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Ksenija Stanojevic

snprintf() may return a value that exceeds its second argument,
show() methods should use scnprintf() instead of snprintf().

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
---
 drivers/staging/fbtft/fbtft-sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fbtft-sysfs.c b/drivers/staging/fbtft/fbtft-sysfs.c
index 8d8bd12..36a1f4e 100644
--- a/drivers/staging/fbtft/fbtft-sysfs.c
+++ b/drivers/staging/fbtft/fbtft-sysfs.c
@@ -198,7 +198,7 @@ static ssize_t show_debug(struct device *device,
 	struct fb_info *fb_info = dev_get_drvdata(device);
 	struct fbtft_par *par = fb_info->par;
 
-	return snprintf(buf, PAGE_SIZE, "%lu\n", par->debug);
+	return scnprintf(buf, PAGE_SIZE, "%lu\n", par->debug);
 }
 
 static struct device_attribute debug_device_attr = \
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-29 20:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-29 19:15 [PATCH] Staging: fbtbt: show() methods should use scnprintf() Ksenija Stanojevic
2015-09-29 19:38 ` [Outreachy kernel] " Greg KH
2015-09-29 19:50   ` Ksenija Stanojević
2015-09-29 20:12     ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.