svn commit: r295188 - user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools
Garrett Cooper
ngie at FreeBSD.org
Wed Feb 3 02:00:21 UTC 2016
Author: ngie
Date: Wed Feb 3 02:00:20 2016
New Revision: 295188
URL: https://svnweb.freebsd.org/changeset/base/295188
Log:
Use destination buffer instead of source buffer size to mute valid
security concerns with strlcpy related to their respective buffer
sizes (-Wstrlcpy-strlcat-size)
Reported by: Jenkins (clang job)
Sponsored by: EMC / Isilon Storage Division
Modified:
user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c
Modified: user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c
==============================================================================
--- user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Wed Feb 3 01:58:37 2016 (r295187)
+++ user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Wed Feb 3 02:00:20 2016 (r295188)
@@ -283,7 +283,7 @@ enum_pair_insert(struct enum_pairs *head
}
e_new->enum_val = enum_val;
- strlcpy(e_new->enum_str, enum_str, strlen(enum_str) + 1);
+ strlcpy(e_new->enum_str, enum_str, strlen(e_new->enum_str));
STAILQ_INSERT_TAIL(headp, e_new, link);
return (1);
@@ -569,7 +569,7 @@ snmp_enumtc_init(char *name)
free(enum_tc);
return (NULL);
}
- strlcpy(enum_tc->name, name, strlen(name) + 1);
+ strlcpy(enum_tc->name, name, sizeof(enum_tc->name));
return (enum_tc);
}
More information about the svn-src-user
mailing list