> --- 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);
 >  }

node_desc isn't really a string, isn't it?  Seems that we should be
using memcpy() here (since I think it is perfectly valid according to
the IB architecture to have NULs in the node description)

 - R.
_______________________________________________
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