lkml.org 
[lkml]   [2015]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] Staging: dgnc: Replace snprintf instead of sprintf
Date
This patch replaces snprintf instead of sprintf to avoid buffer overflow

Signed-off-by: Gnanachandran Dhanapal <gdhanapa@visteon.com>
---
drivers/staging/dgnc/dgnc_mgmt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c
index b13318a..aa20a66 100644
--- a/drivers/staging/dgnc/dgnc_mgmt.c
+++ b/drivers/staging/dgnc/dgnc_mgmt.c
@@ -116,7 +116,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
spin_lock_irqsave(&dgnc_global_lock, flags);

ddi.dinfo_nboards = dgnc_NumBoards;
- sprintf(ddi.dinfo_version, "%s", DG_PART);
+ snprintf(ddi.dinfo_version, strlen(DG_PART)+1, "%s", DG_PART);

spin_unlock_irqrestore(&dgnc_global_lock, flags);

--
1.7.9.5

\
 
 \ /
  Last update: 2015-04-24 14:01    [W:0.030 / U:1.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site