summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/lib/libc
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2017-01-14 00:24:46 +0000
committerngie <ngie@FreeBSD.org>2017-01-14 00:24:46 +0000
commit707a2bc556fe3b6e2b96484e0ed60c572a700f42 (patch)
tree01e3b55b6aaa97d07d204f4b92fcd7b5e020a797 /contrib/netbsd-tests/lib/libc
parent9cc442e137aa9f1daa034de868ae4a19f175ea52 (diff)
downloadFreeBSD-src-707a2bc556fe3b6e2b96484e0ed60c572a700f42.zip
FreeBSD-src-707a2bc556fe3b6e2b96484e0ed60c572a700f42.tar.gz
MFC r310950:
MIB-II: use strlcpy when copying interface names to .ifr_name .ifra_name is assumed to be NUL terminated; using strlcpy(3) ensures that it's indeed NUL terminated whereas strncpy does not. Tested and verified as follows with a combination of ifconfig, snmpget, and snmpset: % ifconfig create lo1 127.0.0.2/8 % SNMPARGS="-v 3 -n '' -u bsnmp -A bsnmptest -l authPriv -a sha -x des -X bsnmptest localhost" % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4 IF-MIB::ifAdminStatus.4 = INTEGER: up(1) % snmpset $SNMPARGS IF-MIB::ifAdminStatus.4 i 2 IF-MIB::ifAdminStatus.4 = INTEGER: down(2) % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4 IF-MIB::ifAdminStatus.4 = INTEGER: down(2) % snmpset $SNMPARGS IF-MIB::ifAdminStatus.4 i 1 IF-MIB::ifAdminStatus.4 = INTEGER: up(1) % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4 IF-MIB::ifAdminStatus.4 = INTEGER: up(1) CID: 1009652-1009656, 1349850
Diffstat (limited to 'contrib/netbsd-tests/lib/libc')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud