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

Đã đóng
%! (template.HTML=8 năm trước cách đây)đang mở bởi carlos.garcia · 2 ý kiến

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 đã nhận xét 8 năm trước cách đây
Chủ sở hữu

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.
Đăng nhập để tham gia bình luận.
Không có nhãn
Bug
Không có Milestone
Không có người được phân công
2 tham gia
Đang tải...
Hủy bỏ
Lưu
Ở đây vẫn chưa có nội dung nào.