From: "DHANAPAL, GNANACHANDRAN (G.)" <gdhanapa@visteon.com>
To: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "lidza.louina@gmail.com" <lidza.louina@gmail.com>,
"markh@compro.net" <markh@compro.net>,
"driverdev-devel@linuxdriverproject.org"
<driverdev-devel@linuxdriverproject.org>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Babu, Viswanathan (V.)" <vbabu3@visteon.com>,
"gnanachandran@gmail.com" <gnanachandran@gmail.com>
Subject: [PATCH] Staging: dgnc: Replace snprintf instead of sprintf
Date: Fri, 24 Apr 2015 11:22:24 +0000 [thread overview]
Message-ID: <20150424112413.GA13642@visteon-gnana> (raw)
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
next reply other threads:[~2015-04-24 11:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-24 11:22 DHANAPAL, GNANACHANDRAN (G.) [this message]
2015-04-24 11:25 ` [PATCH] Staging: dgnc: Replace snprintf instead of sprintf Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150424112413.GA13642@visteon-gnana \
--to=gdhanapa@visteon.com \
--cc=devel@driverdev.osuosl.org \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=gnanachandran@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=lidza.louina@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markh@compro.net \
--cc=vbabu3@visteon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox