Index: snmp_target/target_snmp.c =================================================================== --- snmp_target/target_snmp.c (revision 261746) +++ snmp_target/target_snmp.c (working copy) @@ -301,6 +301,7 @@ op_snmp_target_addrs(struct snmp_context *ctx __un default: break; } + return (SNMP_ERR_NOERROR); default: abort(); @@ -625,6 +626,7 @@ op_snmp_notify(struct snmp_context *ctx __unused, default: break; } + return (SNMP_ERR_NOERROR); default: abort(); @@ -663,13 +665,14 @@ target_append_index(struct asn_oid *oid, uint sub, static int target_decode_index(const struct asn_oid *oid, uint sub, char *name) { - uint32_t i, len; + uint32_t i; - if ((len = oid->len - sub) >= SNMP_ADM_STR32_SIZ) + if (oid->len - sub != oid->subs[sub] + 1 || oid->subs[sub] >= + SNMP_ADM_STR32_SIZ) return (-1); - for (i = 0; i < len; i++) - name[i] = oid->subs[sub + i]; + for (i = 0; i < oid->subs[sub]; i++) + name[i] = oid->subs[sub + i + 1]; name[i] = '\0'; return (0);