From 51805d0c414df1d6339ce5243c6c4a5a0726518e Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 23 Sep 2003 18:36:49 +0000 Subject: From Graeme Reid: modified PER choice dissector to correctly handle numbered choices starting with non-zero values (eg X.880 ROS). svn path=/trunk/; revision=8519 --- packet-per.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'packet-per.c') diff --git a/packet-per.c b/packet-per.c index ed5e93e412..4f130d48e3 100644 --- a/packet-per.c +++ b/packet-per.c @@ -7,7 +7,7 @@ proper helper routines * Routines for dissection of ASN.1 Aligned PER * 2003 Ronnie Sahlberg * - * $Id: packet-per.c,v 1.16 2003/09/01 23:47:01 guy Exp $ + * $Id: packet-per.c,v 1.17 2003/09/23 18:36:49 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -917,6 +917,8 @@ dissect_per_choice(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree proto_item *it=NULL; proto_tree *tr=NULL; guint32 old_offset=offset; + int min_choice=INT_MAX; + int max_choice=-1; DEBUG_ENTRY("dissect_per_choice"); @@ -946,6 +948,12 @@ DEBUG_ENTRY("dissect_per_choice"); switch(choice[i].extension){ case NO_EXTENSIONS: case EXTENSION_ROOT: + if(choice[i].valuemax_choice){ + max_choice=choice[i].value; + } extension_root_entries++; break; } @@ -962,7 +970,7 @@ DEBUG_ENTRY("dissect_per_choice"); /* 22.7 */ /*qqq make it similar to the section below instead */ offset=dissect_per_constrained_integer(tvb, offset, pinfo, - tr, hf_index, 0, extension_root_entries-1, + tr, hf_index, min_choice, max_choice, &choice_index, &choiceitem, FALSE); if(value){ *value=choice_index; -- cgit v1.2.3