From 533eb6f7e2794900851f04d9a381c24f47cb87f0 Mon Sep 17 00:00:00 2001 From: Jaganath Kanakkassery Date: Thu, 2 Feb 2012 17:04:01 +0530 Subject: [PATCH] obexd: Fix length parameter of strncpy --- obexd/plugins/irmc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/obexd/plugins/irmc.c b/obexd/plugins/irmc.c index 6f28e51f7..8344a478c 100644 --- a/obexd/plugins/irmc.c +++ b/obexd/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. -- 2.47.3