Messages in this thread Patch in this message | | | From | Rickard Strandqvist <> | Subject | [PATCH] infiniband: hw: cxgb3: cxio_hal.c: Cleaning up missing null-terminate after strncpy call | Date | Mon, 18 Aug 2014 00:40:24 +0200 |
| |
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
| |