Acked-by: Ralph Campbell <[email protected]>

On Fri, 2009-07-17 at 07:22 -0700, Roel Kluin wrote:
> strlcpy() will always null terminate the string.
> 
> Signed-off-by: Roel Kluin <[email protected]>
> ---
> Please use this one instead
> 
> diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c 
> b/drivers/infiniband/hw/ipath/ipath_file_ops.c
> index 2317398..38a2870 100644
> --- a/drivers/infiniband/hw/ipath/ipath_file_ops.c
> +++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c
> @@ -1616,7 +1616,7 @@ static int try_alloc_port(struct ipath_devdata *dd, int 
> port,
>               pd->port_cnt = 1;
>               port_fp(fp) = pd;
>               pd->port_pid = get_pid(task_pid(current));
> -             strncpy(pd->port_comm, current->comm, sizeof(pd->port_comm));
> +             strlcpy(pd->port_comm, current->comm, sizeof(pd->port_comm));
>               ipath_stats.sps_ports++;
>               ret = 0;
>       } else
> diff --git a/drivers/infiniband/hw/ipath/ipath_mad.c 
> b/drivers/infiniband/hw/ipath/ipath_mad.c
> index 16a702d..458a918 100644
> --- a/drivers/infiniband/hw/ipath/ipath_mad.c
> +++ b/drivers/infiniband/hw/ipath/ipath_mad.c
> @@ -60,7 +60,7 @@ static int recv_subn_get_nodedescription(struct ib_smp *smp,
>       if (smp->attr_mod)
>               smp->status |= IB_SMP_INVALID_FIELD;
>  
> -     strncpy(smp->data, ibdev->node_desc, sizeof(smp->data));
> +     strlcpy(smp->data, ibdev->node_desc, sizeof(smp->data));
>  
>       return reply(smp);
>  }
> 
> _______________________________________________
> general mailing list
> [email protected]
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
> 
> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to