Skip to content
Snippets Groups Projects
Commit 4bc77189 authored by mtu's avatar mtu Committed by mtu
Browse files

[amend: unsuccessful fix] Fix recursion bug in ASN1F_optional

parent 707fe9aa
No related branches found
No related tags found
No related merge requests found
......@@ -35,8 +35,7 @@ class ASN1F_field(ASN1F_element):
def __init__(self, name, default, context=None,
implicit_tag=None, explicit_tag=None):
if context is not None:
self.context = context
self.context = context
self.name = name
if default is None:
self.default = None
......@@ -371,21 +370,17 @@ class ASN1F_optional(ASN1F_element):
def __init__(self, field, by_default=False):
field.flexible_tag = False
self._field = field
self.default = field.default
self.name = field.name
self.islist = field.islist
self.holds_packets = field.holds_packets
def __getattr__(self, attr):
return getattr(self._field, attr)
def m2i(self, pkt, s):
try:
return self._field.m2i(pkt, s)
except (ASN1_Error, ASN1F_badsequence, BER_Decoding_Error):
except (ASN1F_badsequence, BER_Decoding_Error):
return None, s
def dissect(self, pkt, s):
try:
return self._field.dissect(pkt, s)
except (ASN1_Error, ASN1F_badsequence, BER_Decoding_Error):
except (ASN1F_badsequence, BER_Decoding_Error):
self._field.set_val(pkt, None)
return s
def build(self, pkt):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment