diff options
author | ngie <ngie@FreeBSD.org> | 2016-05-15 00:13:36 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2016-05-15 00:13:36 +0000 |
commit | e72268dbe4f113842c1895a4085b55184a9c5330 (patch) | |
tree | 10f485bb69bb2724158f9e8ce38b31f5ee5505ca /contrib/bsnmp | |
parent | f8efc8ecc67c684d2e7e6336e35d06f6650ddced (diff) | |
download | FreeBSD-src-e72268dbe4f113842c1895a4085b55184a9c5330.zip FreeBSD-src-e72268dbe4f113842c1895a4085b55184a9c5330.tar.gz |
Use sizeof(..)s for the destination buffers instead of hardcoded values corresponding
to the destination buffer sizes
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'contrib/bsnmp')
-rw-r--r-- | contrib/bsnmp/snmp_usm/usm_snmp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/bsnmp/snmp_usm/usm_snmp.c b/contrib/bsnmp/snmp_usm/usm_snmp.c index d43baa9..6b7d0eb 100644 --- a/contrib/bsnmp/snmp_usm/usm_snmp.c +++ b/contrib/bsnmp/snmp_usm/usm_snmp.c @@ -262,7 +262,7 @@ op_usm_users(struct snmp_context *ctx, struct snmp_value *val, if (ctx->scratch->ptr1 == NULL) return (SNMP_ERR_GENERR); memcpy(ctx->scratch->ptr1, uuser->suser.priv_key, - SNMP_PRIV_KEY_SIZ); + sizeof(uuser->suser.priv_key)); memcpy(uuser->suser.priv_key, val->v.octetstring.octets, val->v.octetstring.len); break; @@ -286,7 +286,7 @@ op_usm_users(struct snmp_context *ctx, struct snmp_value *val, uuser->user_public_len = val->v.octetstring.len; } else { memset(uuser->user_public, 0, - SNMP_ADM_STR32_SIZ); + sizeof(uuser->user_public)); uuser->user_public_len = 0; } break; @@ -351,7 +351,7 @@ op_usm_users(struct snmp_context *ctx, struct snmp_value *val, case LEAF_usmUserAuthKeyChange: case LEAF_usmUserOwnAuthKeyChange: memcpy(uuser->suser.auth_key, ctx->scratch->ptr1, - SNMP_AUTH_KEY_SIZ); + sizeof(uuser->suser.auth_key)); free(ctx->scratch->ptr1); break; case LEAF_usmUserPrivProtocol: @@ -360,7 +360,7 @@ op_usm_users(struct snmp_context *ctx, struct snmp_value *val, 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: @@ -371,7 +371,7 @@ op_usm_users(struct snmp_context *ctx, struct snmp_value *val, free(ctx->scratch->ptr2); } else { memset(uuser->user_public, 0, - SNMP_ADM_STR32_SIZ); + sizeof(uuser->user_public)); uuser->user_public_len = 0; } break; |