#16 After loading a label's file, the application crashes

بسته‌شده
7 سال پیش باز شده توسط carlos.garcia · 2 دیدگاه

The crash message is:

Input file: test_me_short_20161102-164436.pcap
Label file found. Loading labels...
Traceback (most recent call last):
  File "./CLI.py", line 113, in <module>
    main(sys.argv[1:])
  File "./CLI.py", line 108, in main
    cli.parse_arguments(args)
  File "./CLI.py", line 97, in parse_arguments
    self.process_arguments()
  File "./CLI.py", line 32, in process_arguments
    controller = Controller(self.args.input)
  File "/home/boy/Documents/CASED/Repos/id2t/code/ID2TLib/Controller.py", line 23, in __init__
    self.label_manager = LabelManager(self.pcap_src_path)
  File "/home/boy/Documents/CASED/Repos/id2t/code/ID2TLib/LabelManager.py", line 34, in __init__
    self._load_labels()
  File "/home/boy/Documents/CASED/Repos/id2t/code/ID2TLib/LabelManager.py", line 136, in _load_labels
    attack_note = a.childNodes[3].firstChild.data
AttributeError: 'NoneType' object has no attribute 'data'

There are no notes in the XML file, is this what is not correctly parsed?

The crash message is: Input file: test_me_short_20161102-164436.pcap Label file found. Loading labels... Traceback (most recent call last): File "./CLI.py", line 113, in <module> main(sys.argv[1:]) File "./CLI.py", line 108, in main cli.parse_arguments(args) File "./CLI.py", line 97, in parse_arguments self.process_arguments() File "./CLI.py", line 32, in process_arguments controller = Controller(self.args.input) File "/home/boy/Documents/CASED/Repos/id2t/code/ID2TLib/Controller.py", line 23, in __init__ self.label_manager = LabelManager(self.pcap_src_path) File "/home/boy/Documents/CASED/Repos/id2t/code/ID2TLib/LabelManager.py", line 34, in __init__ self._load_labels() File "/home/boy/Documents/CASED/Repos/id2t/code/ID2TLib/LabelManager.py", line 136, in _load_labels attack_note = a.childNodes[3].firstChild.data AttributeError: 'NoneType' object has no attribute 'data' There are no notes in the XML file, is this what is not correctly parsed?
Carlos Garcia نظر 7 سال پیش
مالک

Having an empty "notes" field is indeed the problem. The XML is not being parsed correctly. On that same note, the program should be resilient against loading corrupted "label's files". That is, if it cannot parse it correctly, it should just drop it as if no label's file was found.

Having an empty "notes" field is indeed the problem. The XML is not being parsed correctly. On that same note, the program should be resilient against loading corrupted "label's files". That is, if it cannot parse it correctly, it should just drop it as if no label's file was found.

Parsing is now fixed - it uses the tags name defined as constants in the class (and also used for XML file generation) instead of a hard coded values. Further, if the XML parsing failed, the application just ignores the file.

Parsing is now fixed - it uses the tags name defined as constants in the class (and also used for XML file generation) instead of a hard coded values. Further, if the XML parsing failed, the application just ignores the file.
برای پیوستن به گفتگو، وارد شودید.
بدون برچسب
Bug
بدون نقطه عطف
بدون مسئول رسیدگی
2 مشارکت کننده
درحال بارگذاری...
لغو
ذخيره
هنوز محتوایی ایجاد نشده.