public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] infiniband: hw: cxgb3: cxio_hal.c:  Cleaning up missing null-terminate after strncpy call
@ 2014-08-17 22:40 Rickard Strandqvist
  2014-08-18 13:30 ` Yann Droneaud
  2014-08-18 14:27 ` Steve Wise
  0 siblings, 2 replies; 4+ messages in thread
From: Rickard Strandqvist @ 2014-08-17 22:40 UTC (permalink / raw)
  To: Steve Wise, Roland Dreier
  Cc: Rickard Strandqvist, Sean Hefty, Hal Rosenstock, linux-rdma,
	linux-kernel

Added a guaranteed null-terminate after call to strncpy.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/infiniband/hw/cxgb3/cxio_hal.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.c b/drivers/infiniband/hw/cxgb3/cxio_hal.c
index de1c61b4..5fc04e4 100644
--- a/drivers/infiniband/hw/cxgb3/cxio_hal.c
+++ b/drivers/infiniband/hw/cxgb3/cxio_hal.c
@@ -933,6 +933,7 @@ int cxio_rdev_open(struct cxio_rdev *rdev_p)
 		netdev_p = rdev_p->t3cdev_p->lldev;
 		strncpy(rdev_p->dev_name, rdev_p->t3cdev_p->name,
 			T3_MAX_DEV_NAME_LEN);
+		rdev_p->dev_name[T3_MAX_DEV_NAME_LEN - 1] = '\0';
 	} else {
 		PDBG("%s t3cdev_p or dev_name must be set\n", __func__);
 		return -EINVAL;
-- 
1.7.10.4

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

end of thread, other threads:[~2014-08-18 16:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-17 22:40 [PATCH] infiniband: hw: cxgb3: cxio_hal.c: Cleaning up missing null-terminate after strncpy call Rickard Strandqvist
2014-08-18 13:30 ` Yann Droneaud
2014-08-18 14:27 ` Steve Wise
2014-08-18 16:25   ` Rickard Strandqvist

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox