summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2017-02-04 16:37:43 +0000
committerngie <ngie@FreeBSD.org>2017-02-04 16:37:43 +0000
commit6192a1f1dadc7eb4e1c6486b36c916b13ba9c60d (patch)
tree8fccc49032db379aa14c3c614cda02f2672783b8
parentb9bbda979fe02a0b9a932c59b6cac7b9c5feb428 (diff)
downloadFreeBSD-src-6192a1f1dadc7eb4e1c6486b36c916b13ba9c60d.zip
FreeBSD-src-6192a1f1dadc7eb4e1c6486b36c916b13ba9c60d.tar.gz
MFC r311394:
op_usm_users: don't deref uusers if it's NULL when SETting the value Add an XXX comment to note that the conditional seems suspect given how it's handled elsewhere in the SNMP_OP_SET case. CID: 1008573
-rw-r--r--contrib/bsnmp/snmp_usm/usm_snmp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/bsnmp/snmp_usm/usm_snmp.c b/contrib/bsnmp/snmp_usm/usm_snmp.c
index 6ed639a..a6c7b86 100644
--- a/contrib/bsnmp/snmp_usm/usm_snmp.c
+++ b/contrib/bsnmp/snmp_usm/usm_snmp.c
@@ -169,8 +169,12 @@ op_usm_users(struct snmp_context *ctx, struct snmp_value *val,
val->var.subs[sub - 1] != LEAF_usmUserCloneFrom)
return (SNMP_ERR_NOSUCHNAME);
+ /*
+ * XXX (ngie): need to investigate the MIB to determine how
+ * this is possible given some of the transitions below.
+ */
if (community != COMM_INITIALIZE &&
- uuser->type == StorageType_readOnly)
+ uuser != NULL && uuser->type == StorageType_readOnly)
return (SNMP_ERR_NOT_WRITEABLE);
switch (val->var.subs[sub - 1]) {
OpenPOWER on IntegriCloud