svn commit: r299647 - user/ngie/bsnmp_cleanup/contrib/bsnmp/snmp_usm

Garrett Cooper ngie at FreeBSD.org
Fri May 13 09:42:59 UTC 2016


Author: ngie
Date: Fri May 13 09:42:57 2016
New Revision: 299647
URL: https://svnweb.freebsd.org/changeset/base/299647

Log:
  Follow up to r299465
  
  Use the size of the destination buffer, not SNMP_PRIV_KEY_SIZ.
  
  The latter form is more prone to fall victim to buffer size changes

Modified:
  user/ngie/bsnmp_cleanup/contrib/bsnmp/snmp_usm/usm_snmp.c

Modified: user/ngie/bsnmp_cleanup/contrib/bsnmp/snmp_usm/usm_snmp.c
==============================================================================
--- user/ngie/bsnmp_cleanup/contrib/bsnmp/snmp_usm/usm_snmp.c	Fri May 13 09:37:53 2016	(r299646)
+++ user/ngie/bsnmp_cleanup/contrib/bsnmp/snmp_usm/usm_snmp.c	Fri May 13 09:42:57 2016	(r299647)
@@ -360,7 +360,7 @@ op_usm_users(struct snmp_context *ctx, s
 		case LEAF_usmUserPrivKeyChange:
 		case LEAF_usmUserOwnPrivKeyChange:
 			memcpy(uuser->suser.priv_key, ctx->scratch->ptr1,
-			    SNMP_PRIV_KEY_SIZ);
+			    sizeof(uuser->suser.priv_key));
 			free(ctx->scratch->ptr1);
 			break;
 		case LEAF_usmUserPublic:


More information about the svn-src-user mailing list