diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2013-02-01 22:44:14 +0000 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2013-02-01 22:44:14 +0000 |
commit | f26b2505953c4d4814fbaf8d6dddf12e633f5f33 (patch) | |
tree | 35bd298e4d3fe67ca665f8627a0ffb7f200a0e6f /epan/dissectors/packet-per.c | |
parent | 8984a385127683c69f43e9d5a1978b7bef7c6b87 (diff) |
Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8290 :
Allow up to 64 OPTIONAL / DEFAULT components per SEQUENCE
svn path=/trunk/; revision=47433
Diffstat (limited to 'epan/dissectors/packet-per.c')
-rw-r--r-- | epan/dissectors/packet-per.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c index f70c0c86f3..4f7b960373 100644 --- a/epan/dissectors/packet-per.c +++ b/epan/dissectors/packet-per.c @@ -1726,7 +1726,7 @@ dissect_per_sequence(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree proto_tree *tree; guint32 old_offset=offset; guint32 i, num_opts; - guint32 optional_mask; + guint64 optional_mask; DEBUG_ENTRY("dissect_per_sequence"); @@ -1753,6 +1753,9 @@ DEBUG_ENTRY("dissect_per_sequence"); num_opts++; } } + if (num_opts > 64) { + PER_NOT_DECODED_YET("more than 64 optional/default components"); + } optional_mask=0; for(i=0;i<num_opts;i++){ @@ -1778,7 +1781,7 @@ DEBUG_ENTRY("dissect_per_sequence"); if (num_opts == 0){ continue; } - is_present=(1<<(num_opts-1))&optional_mask; + is_present=(((guint64)1<<(num_opts-1))&optional_mask) ? TRUE : FALSE; num_opts--; if(!is_present){ continue; @@ -1902,7 +1905,7 @@ dissect_per_sequence_eag(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_ { gboolean optional_field_flag; guint32 i, num_opts; - guint32 optional_mask; + guint64 optional_mask; DEBUG_ENTRY("dissect_per_sequence_eag"); @@ -1912,6 +1915,9 @@ DEBUG_ENTRY("dissect_per_sequence_eag"); num_opts++; } } + if (num_opts > 64) { + PER_NOT_DECODED_YET("more than 64 optional/default components"); + } optional_mask=0; for(i=0;i<num_opts;i++){ @@ -1933,7 +1939,7 @@ DEBUG_ENTRY("dissect_per_sequence_eag"); if (num_opts == 0){ continue; } - is_present=(1<<(num_opts-1))&optional_mask; + is_present=(((guint64)1<<(num_opts-1))&optional_mask) ? TRUE : FALSE; num_opts--; if(!is_present){ continue; |