Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Jan 2017 09:46:36 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r311394 - head/contrib/bsnmp/snmp_usm
Message-ID:  <201701050946.v059kaAU006665@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Thu Jan  5 09:46:36 2017
New Revision: 311394
URL: https://svnweb.freebsd.org/changeset/base/311394

Log:
  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.
  
  MFC after:	2 weeks
  Reported by:	Coverity
  CID:		1008573

Modified:
  head/contrib/bsnmp/snmp_usm/usm_snmp.c

Modified: head/contrib/bsnmp/snmp_usm/usm_snmp.c
==============================================================================
--- head/contrib/bsnmp/snmp_usm/usm_snmp.c	Thu Jan  5 09:28:38 2017	(r311393)
+++ head/contrib/bsnmp/snmp_usm/usm_snmp.c	Thu Jan  5 09:46:36 2017	(r311394)
@@ -169,8 +169,12 @@ op_usm_users(struct snmp_context *ctx, s
 		    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]) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701050946.v059kaAU006665>