diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2010-09-17 14:03:05 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2010-09-17 14:03:05 +0000 |
commit | 9ac49c557d9b14d0f67189d4baff855b588aa91a (patch) | |
tree | e99fe7bff94e3e3020bbd05a3c90c03507a3c264 /asn1 | |
parent | 20cc0d7ce9e5f792f243590963e6f2b15caa7ed0 (diff) |
Copy the rev 34143 changes to packet-snmp.c over to the asn1 source.
hf_snmp_engineid_enterprise is now a BASE_EXT_STRING, not BASE_RANGE_STRING. This fixes
the fuzz failure in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5233
svn path=/trunk/; revision=34151
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/snmp/packet-snmp-template.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/asn1/snmp/packet-snmp-template.c b/asn1/snmp/packet-snmp-template.c index 6649b9d824..bf0305eb6e 100644 --- a/asn1/snmp/packet-snmp-template.c +++ b/asn1/snmp/packet-snmp-template.c @@ -757,13 +757,13 @@ indexing_done: gint64 val=0; unsigned offset = value_offset; unsigned i; - + max_len = 5; min_len = 1; if (value_len > (guint)max_len && value_len < (guint)min_len) { format_error = BER_WRONG_LENGTH; break; } - + if(value_len > 0) { /* extend sign bit */ if(tvb_get_guint8(tvb, offset)&0x80){ @@ -828,7 +828,7 @@ indexing_done: pi_value = proto_tree_add_item(pt_varbind,hfid,tvb,value_offset,value_len,FALSE); expert_add_info_format(actx->pinfo, pi_value, PI_UNDECODED, PI_NOTE, "Unresolved value, Missing MIB"); } - + already_added: oid_info_is_ok = FALSE; } @@ -1900,7 +1900,7 @@ static void* snmp_users_copy_cb(void* dest, const void* orig, unsigned len _U_) d->user.privKey.data = o->user.privKey.data ? g_memdup(o->user.privKey.data,o->user.privKey.len) : NULL; d->user.privKey.len = o->user.privKey.len; - + return d; } @@ -1918,7 +1918,7 @@ static void snmp_users_update_cb(void* p _U_, const char** err) { snmp_ue_assoc_t* ue = p; GString* es = g_string_new(""); unsigned i; - + *err = NULL; if (num_ueas == 0) @@ -1930,18 +1930,18 @@ static void snmp_users_update_cb(void* p _U_, const char** err) { for (i=0; i<num_ueas-1; i++) { snmp_ue_assoc_t* u = &(ueas[i]); - - + + if ( u->user.userName.len == ue->user.userName.len && u->engine.len == ue->engine.len ) { - + if (u->engine.len > 0 && memcmp( u->engine.data, ue->engine.data, u->engine.len ) == 0) { if ( memcmp( u->user.userName.data, ue->user.userName.data, ue->user.userName.len ) == 0 ) { /* XXX: make a string for the engineId */ g_string_append_printf(es,"duplicate key (userName='%s')\n",ue->user.userName.data); } } - + if (u->engine.len == 0) { if ( memcmp( u->user.userName.data, ue->user.userName.data, ue->user.userName.len ) == 0 ) { g_string_append_printf(es,"duplicate key (userName='%s' engineId=NONE)\n",ue->user.userName.data); @@ -1949,12 +1949,12 @@ static void snmp_users_update_cb(void* p _U_, const char** err) { } } } - + if (es->len) { g_string_truncate(es,es->len-2); *err = ep_strdup(es->str); } - + g_string_free(es,TRUE); return; @@ -2011,8 +2011,8 @@ void proto_register_snmp(void) { "Engine ID Conformance", "snmp.engineid.conform", FT_BOOLEAN, 8, TFS(&tfs_snmp_engineid_conform), F_SNMP_ENGINEID_CONFORM, "Engine ID RFC3411 Conformance", HFILL }}, { &hf_snmp_engineid_enterprise, { - "Engine Enterprise ID", "snmp.engineid.enterprise", FT_UINT32, BASE_DEC, - VALS(sminmpec_values), 0, NULL, HFILL }}, + "Engine Enterprise ID", "snmp.engineid.enterprise", FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &sminmpec_values_ext, 0, NULL, HFILL }}, { &hf_snmp_engineid_format, { "Engine ID Format", "snmp.engineid.format", FT_UINT8, BASE_DEC, VALS(snmp_engineid_format_vals), 0, NULL, HFILL }}, |