diff options
author | Ruslan Ermilov <ru@FreeBSD.org> | 2005-02-03 12:50:10 +0000 |
---|---|---|
committer | Ruslan Ermilov <ru@FreeBSD.org> | 2005-02-03 12:50:10 +0000 |
commit | bbb75d78443429fdfa6f977108a2df7b8f1d643a (patch) | |
tree | d24165c984e709df9f05c60e3bc71cc46df936e1 /sys/netgraph/ng_ether.c | |
parent | c60878f0d266f8f94f66f99e7fcc2f108cd8309e (diff) | |
download | src-bbb75d78443429fdfa6f977108a2df7b8f1d643a.tar.gz src-bbb75d78443429fdfa6f977108a2df7b8f1d643a.zip |
Fixed an off-by-one error when dealing with interface name
(if_xname is IFNAMSIZ-sized and NUL-terminated).
Notes
Notes:
svn path=/head/; revision=141195
Diffstat (limited to 'sys/netgraph/ng_ether.c')
-rw-r--r-- | sys/netgraph/ng_ether.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c index a3932a19a660..12ab4db9050e 100644 --- a/sys/netgraph/ng_ether.c +++ b/sys/netgraph/ng_ether.c @@ -420,12 +420,12 @@ ng_ether_rcvmsg(node_p node, item_p item, hook_p lasthook) case NGM_ETHER_COOKIE: switch (msg->header.cmd) { case NGM_ETHER_GET_IFNAME: - NG_MKRESPONSE(resp, msg, IFNAMSIZ + 1, M_NOWAIT); + NG_MKRESPONSE(resp, msg, IFNAMSIZ, M_NOWAIT); if (resp == NULL) { error = ENOMEM; break; } - strlcpy(resp->data, priv->ifp->if_xname, IFNAMSIZ + 1); + strlcpy(resp->data, priv->ifp->if_xname, IFNAMSIZ); break; case NGM_ETHER_GET_IFINDEX: NG_MKRESPONSE(resp, msg, sizeof(u_int32_t), M_NOWAIT); |