[SSSD] [PATCH] netlink integration: ensure that interface name is NULL-terminated

Stephen Gallagher sgallagh at redhat.com
Thu Apr 5 23:03:52 UTC 2012


On Thu, 2012-04-05 at 14:23 -0400, Jakub Hrozek wrote:
> On Thu, Apr 05, 2012 at 11:15:18AM -0700, Stephen Gallagher wrote:
> > On Thu, 2012-04-05 at 14:07 -0400, Jakub Hrozek wrote:
> > > Reported in https://bugzilla.redhat.com/show_bug.cgi?id=808107
> > > 
> > > In the unlikely case that the interface name was IFNAMSIZ bytes long or
> > > longer, strncpy wouldn't NULL-terminate the buffer. Copy one byte less
> > > to ensure the buffer is NULL-terminated.
> > 
> > Nack, this is incomplete. You need to do:
> > 
> > strncpy(iwr.ifr_ifrn.ifrn_name, ifname, IFNAMSIZ-1);
> > iwr.ifr_ifrn.ifrn_name[IFNAMSIZ-1] = '\0';
> 
> Thank you, a new patch is attached.

Ack
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120405/049adad3/attachment.sig>


More information about the sssd-devel mailing list