Module Name: src Committed By: christos Date: Thu Nov 14 04:24:33 UTC 2013
Modified Files: src/external/bsd/dhcpcd/dist: if-options.c Log Message: CID 1102787: Only copy the interface name if it is NUL terminated, avoiding a buffer overrun by one in the equals case. To generate a diff of this commit: cvs rdiff -u -r1.1.1.21 -r1.2 src/external/bsd/dhcpcd/dist/if-options.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/dhcpcd/dist/if-options.c diff -u src/external/bsd/dhcpcd/dist/if-options.c:1.1.1.21 src/external/bsd/dhcpcd/dist/if-options.c:1.2 --- src/external/bsd/dhcpcd/dist/if-options.c:1.1.1.21 Fri Sep 20 06:51:29 2013 +++ src/external/bsd/dhcpcd/dist/if-options.c Wed Nov 13 23:24:33 2013 @@ -1,5 +1,5 @@ #include <sys/cdefs.h> - __RCSID("$NetBSD: if-options.c,v 1.1.1.21 2013/09/20 10:51:29 roy Exp $"); + __RCSID("$NetBSD: if-options.c,v 1.2 2013/11/14 04:24:33 christos Exp $"); /* * dhcpcd - DHCP client daemon @@ -1168,9 +1168,8 @@ finish_config6(struct if_options *ifo, c if (ifo->ia_type == 0) ifo->ia_type = D6_OPTION_IA_NA; ifo->iaid_len = strlen(ifname); - if (ifo->iaid_len <= sizeof(ifo->iaid->iaid)) { - strncpy((char *)ifo->iaid->iaid, ifname, - sizeof(ifo->iaid->iaid)); + if (ifo->iaid_len < sizeof(ifo->iaid->iaid)) { + memcpy(ifo->iaid->iaid, ifname, len); memset(ifo->iaid->iaid + ifo->iaid_len, 0, sizeof(ifo->iaid->iaid) -ifo->iaid_len); } else {