diff options
author | Anders Broman <anders.broman@ericsson.com> | 2005-03-31 18:39:45 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2005-03-31 18:39:45 +0000 |
commit | c4e25e0599316be95f80e2933fa1475cc9c1a0e2 (patch) | |
tree | 415df81ffdd4a4f46864aaf199cd1caf2b5a4122 /asn1 | |
parent | 68af7e99c27e0d1deb6113d888986bc623af6ed0 (diff) |
From Jacques, Olivier: Length of digit_str wrongly calculated.
Free the string, fix dissection of some elements.
svn path=/trunk/; revision=13985
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/gsmmap/packet-gsm_map-template.c | 16 | ||||
-rw-r--r-- | asn1/gsmmap/packet-gsm_map-template.h | 1 |
2 files changed, 15 insertions, 2 deletions
diff --git a/asn1/gsmmap/packet-gsm_map-template.c b/asn1/gsmmap/packet-gsm_map-template.c index 83b4f14bc0..f4bb6eb232 100644 --- a/asn1/gsmmap/packet-gsm_map-template.c +++ b/asn1/gsmmap/packet-gsm_map-template.c @@ -113,7 +113,7 @@ gint protocolId; static int gsm_map_tap = -1; -static char* +char* unpack_digits(tvbuff_t *tvb, int offset){ int length; @@ -125,7 +125,7 @@ unpack_digits(tvbuff_t *tvb, int offset){ if (length < offset) return NULL; length = length - offset; - digit_str = g_malloc(length+1); + digit_str = g_malloc(length*2+1); while ( offset <= length ){ @@ -383,7 +383,13 @@ static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tv offset=dissect_gsm_map_UpdateLocationArg(FALSE, tvb, offset, pinfo, tree, -1); break; case 3: /*cancelLocation*/ + octet = tvb_get_guint8(tvb,0) & 0xf; + if ( octet == 3){ /* */ + offset = offset +2; + offset=dissect_gsm_map_CancelLocationArg(TRUE, tvb, offset, pinfo, tree, -1); + }else{ offset=dissect_gsm_map_CancelLocationArg(FALSE, tvb, offset, pinfo, tree, -1); + } break; case 4: /*provideRoamingNumber*/ offset=dissect_gsm_map_ProvideRoamingNumberArg(FALSE, tvb, offset, pinfo, tree, -1); @@ -599,7 +605,13 @@ static int dissect_returnResultData(packet_info *pinfo, proto_tree *tree, tvbuff guint8 octet; switch(opcode){ case 2: /*updateLocation*/ + octet = tvb_get_guint8(tvb,offset); + /* As it seems like SEQUENCE OF sometimes is omitted, find out if it's there */ + if ( octet == 0x30 ){ /* Class 0 Univerasl, P/C 1 Constructed,Tag 16 Sequence OF */ offset=dissect_gsm_map_UpdateLocationRes(FALSE, tvb, offset, pinfo, tree, -1); + }else{ /* Try decoding with IMPLICIT flag set */ + offset=dissect_gsm_map_UpdateLocationRes(TRUE, tvb, offset, pinfo, tree, -1); + } break; case 3: /*cancelLocation*/ offset=dissect_gsm_map_CancelLocationRes(FALSE, tvb, offset, pinfo, tree, -1); diff --git a/asn1/gsmmap/packet-gsm_map-template.h b/asn1/gsmmap/packet-gsm_map-template.h index 3d7dd9ebb0..36362fce0f 100644 --- a/asn1/gsmmap/packet-gsm_map-template.h +++ b/asn1/gsmmap/packet-gsm_map-template.h @@ -36,6 +36,7 @@ typedef struct _gsm_map_tap_rec_t { } gsm_map_tap_rec_t; ETH_VAR_IMPORT const value_string gsm_map_opr_code_strings[]; +char* unpack_digits(tvbuff_t *tvb, int offset); /* #include "packet-gsm_map-exp.h"*/ |