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

닫힘
carlos.garcia8 년 전을 오픈 · 2개의 코멘트
Carlos Garcia 코멘트됨, 8 년 전

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 코멘트됨, 8 년 전
소유자

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.
Patrick Jattke 코멘트됨, 8 년 전

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명
로딩중...
취소
저장
아직 콘텐츠가 없습니다.