aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Quantin <pascal@wireshark.org>2019-10-23 11:26:14 +0200
committerPascal Quantin <pascal@wireshark.org>2019-10-23 20:16:32 +0000
commiteb4e83d5891165ca1f958cf57641200a8cb5a0b4 (patch)
tree8bc0397f99372e3447fda604946bf6dc6f7e6e77
parente50fd8b6088e3f5852802363e5abc792ea91d394 (diff)
asn2wrs.py: fix parsing of integer unions with extension
When parsing the description ExpectedActivityPeriod ::= INTEGER (1..30|40|50|60|80|100|120|150|180|181,...) asn2wrs.py was generating some code where the has_extension flag was wrongly set to false, leading to a decoding error. Bug: 16145 Change-Id: I0d54994c0656f5b48f3dcd1864218c45a4ebc308 Reviewed-on: https://code.wireshark.org/review/34837 Petri-Dish: Pascal Quantin <pascal@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal@wireshark.org>
-rw-r--r--epan/dissectors/packet-ngap.c4
-rw-r--r--epan/dissectors/packet-s1ap.c4
-rw-r--r--epan/dissectors/packet-x2ap.c4
-rw-r--r--epan/dissectors/packet-xnap.c4
-rwxr-xr-xtools/asn2wrs.py2
5 files changed, 9 insertions, 9 deletions
diff --git a/epan/dissectors/packet-ngap.c b/epan/dissectors/packet-ngap.c
index a76403e8ac..724d6b538f 100644
--- a/epan/dissectors/packet-ngap.c
+++ b/epan/dissectors/packet-ngap.c
@@ -4616,7 +4616,7 @@ dissect_ngap_CellType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, p
static int
dissect_ngap_ExpectedActivityPeriod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- 1U, 181U, NULL, FALSE);
+ 1U, 181U, NULL, TRUE);
return offset;
}
@@ -4626,7 +4626,7 @@ dissect_ngap_ExpectedActivityPeriod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
static int
dissect_ngap_ExpectedIdlePeriod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- 1U, 181U, NULL, FALSE);
+ 1U, 181U, NULL, TRUE);
return offset;
}
diff --git a/epan/dissectors/packet-s1ap.c b/epan/dissectors/packet-s1ap.c
index c9f8125a83..1f3d0df9e7 100644
--- a/epan/dissectors/packet-s1ap.c
+++ b/epan/dissectors/packet-s1ap.c
@@ -5914,7 +5914,7 @@ dissect_s1ap_EUTRANRoundTripDelayEstimationInfo(tvbuff_t *tvb _U_, int offset _U
static int
dissect_s1ap_ExpectedActivityPeriod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- 1U, 181U, NULL, FALSE);
+ 1U, 181U, NULL, TRUE);
return offset;
}
@@ -5924,7 +5924,7 @@ dissect_s1ap_ExpectedActivityPeriod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
static int
dissect_s1ap_ExpectedIdlePeriod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- 1U, 181U, NULL, FALSE);
+ 1U, 181U, NULL, TRUE);
return offset;
}
diff --git a/epan/dissectors/packet-x2ap.c b/epan/dissectors/packet-x2ap.c
index d271e9b982..378b4cd246 100644
--- a/epan/dissectors/packet-x2ap.c
+++ b/epan/dissectors/packet-x2ap.c
@@ -6104,7 +6104,7 @@ dissect_x2ap_EventType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
static int
dissect_x2ap_ExpectedActivityPeriod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- 1U, 181U, NULL, FALSE);
+ 1U, 181U, NULL, TRUE);
return offset;
}
@@ -6114,7 +6114,7 @@ dissect_x2ap_ExpectedActivityPeriod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
static int
dissect_x2ap_ExpectedIdlePeriod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- 1U, 181U, NULL, FALSE);
+ 1U, 181U, NULL, TRUE);
return offset;
}
diff --git a/epan/dissectors/packet-xnap.c b/epan/dissectors/packet-xnap.c
index 44e36689af..5ca7c8c2f2 100644
--- a/epan/dissectors/packet-xnap.c
+++ b/epan/dissectors/packet-xnap.c
@@ -4526,7 +4526,7 @@ dissect_xnap_EventType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
static int
dissect_xnap_ExpectedActivityPeriod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- 1U, 181U, NULL, FALSE);
+ 1U, 181U, NULL, TRUE);
return offset;
}
@@ -4557,7 +4557,7 @@ dissect_xnap_ExpectedHOInterval(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a
static int
dissect_xnap_ExpectedIdlePeriod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- 1U, 181U, NULL, FALSE);
+ 1U, 181U, NULL, TRUE);
return offset;
}
diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py
index 2be62b533c..dc6e0a953f 100755
--- a/tools/asn2wrs.py
+++ b/tools/asn2wrs.py
@@ -3548,7 +3548,7 @@ class Constraint (Node):
if self.subtype[0].IsValue() and self.subtype[1].IsValue():
v0 = self.subtype[0].GetValue(ectx)
v1 = self.subtype[1].GetValue(ectx)
- (minv, maxv, ext) = (ectx.value_min(v0[0],v1[0]), ectx.value_max(v0[1],v1[1]), v0[2] or v1[2])
+ (minv, maxv, ext) = (ectx.value_min(v0[0],v1[0]), ectx.value_max(v0[1],v1[1]), hasattr(self, 'ext') and self.ext)
return (minv, maxv, ext)
def IsAlphabet(self):