linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jaganath Kanakkassery <jaganath.k@samsung.com>
To: linux-bluetooth@vger.kernel.org
Cc: Jaganath Kanakkassery <jaganath.k@samsung.com>
Subject: [PATCH obexd 3/4] irmc: Fix length parameter of strncpy
Date: Thu, 02 Feb 2012 17:04:01 +0530	[thread overview]
Message-ID: <1328182441-14892-1-git-send-email-jaganath.k@samsung.com> (raw)

---
 plugins/irmc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugins/irmc.c b/plugins/irmc.c
index 6f28e51..8344a47 100644
--- a/plugins/irmc.c
+++ b/plugins/irmc.c
@@ -215,9 +215,9 @@ static void *irmc_connect(struct obex_session *os, int *err)
 	 * For now lets used hostname and some 'random' value
 	 */
 	gethostname(irmc->did, DID_LEN);
-	strncpy(irmc->sn, "12345", DID_LEN);
-	strncpy(irmc->manu, "obex", DID_LEN);
-	strncpy(irmc->model, "mymodel", DID_LEN);
+	strncpy(irmc->sn, "12345", sizeof(irmc->sn) - 1);
+	strncpy(irmc->manu, "obex", sizeof(irmc->manu) - 1);
+	strncpy(irmc->model, "mymodel", sizeof(irmc->model) - 1);
 
 	/* We need to know the number of contact/cal/nt entries
 	 * somewhere so why not do it now.
-- 
1.7.1


             reply	other threads:[~2012-02-02 11:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-02 11:34 Jaganath Kanakkassery [this message]
2012-02-02 17:29 ` [PATCH obexd 3/4] irmc: Fix length parameter of strncpy Luiz Augusto von Dentz
2012-02-03 12:22   ` Jaganath
2012-02-09 11:07     ` Luiz Augusto von Dentz
2012-02-09 11:16       ` Jaganath
2012-02-09 11:03 ` Johan Hedberg

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=1328182441-14892-1-git-send-email-jaganath.k@samsung.com \
    --to=jaganath.k@samsung.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).