summaryrefslogtreecommitdiffstats
path: root/sys/net/if_mib.c
diff options
context:
space:
mode:
authorcperciva <cperciva@FreeBSD.org>2005-05-06 02:50:00 +0000
committercperciva <cperciva@FreeBSD.org>2005-05-06 02:50:00 +0000
commite513415af91332f009d9733c7156e1a4a60c244f (patch)
treeb49c2e551390ab52afef3a68a53ec4b29faefa23 /sys/net/if_mib.c
parente4a28513e82eb23a2f1155a31e13cd9091ff21be (diff)
downloadFreeBSD-src-e513415af91332f009d9733c7156e1a4a60c244f.zip
FreeBSD-src-e513415af91332f009d9733c7156e1a4a60c244f.tar.gz
If we are going to
1. Copy a NULL-terminated string into a fixed-length buffer, and 2. copyout that buffer to userland, we really ought to 0. Zero the entire buffer first. Security: FreeBSD-SA-05:08.kmem
Diffstat (limited to 'sys/net/if_mib.c')
-rw-r--r--sys/net/if_mib.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/net/if_mib.c b/sys/net/if_mib.c
index 4f6631b..0c11454 100644
--- a/sys/net/if_mib.c
+++ b/sys/net/if_mib.c
@@ -90,6 +90,7 @@ sysctl_ifdata(SYSCTL_HANDLER_ARGS) /* XXX bad syntax! */
return ENOENT;
case IFDATA_GENERAL:
+ bzero(&ifmd, sizeof(ifmd));
strlcpy(ifmd.ifmd_name, ifp->if_xname, sizeof(ifmd.ifmd_name));
#define COPY(fld) ifmd.ifmd_##fld = ifp->if_##fld
OpenPOWER on IntegriCloud