bsnmp: Don't overrun privkey buffer by copying wrong size

The 'priv_key' array is SNMP_PRIV_KEY_SIZ bytes, not SNMP_AUTH_KEY_SIZ.

Reported by:	Coverity
CIDs:		1008326, 1009675
Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
Conrad Meyer 2016-05-11 16:54:34 +00:00
parent 94e989e75f
commit 5f0d846034

View File

@ -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_AUTH_KEY_SIZ);
SNMP_PRIV_KEY_SIZ);
free(ctx->scratch->ptr1);
break;
case LEAF_usmUserPublic: