bulk_extractor icon indicating copy to clipboard operation
bulk_extractor copied to clipboard

Whitelist stats go to stdout but not to report.xml

Open BruceMty opened this issue 10 years ago • 1 comments

Whitelist stats are reported to stdout but not to report.xml.

Specifically:

When bulk_extractor initializes in main.cpp, it reads any alert list(s) and stop list(s) using function word_and_context_list::readfile in file word_and_context_list.cpp. Unfortunately, bulk_extractor does this before opening report.xml as pointer variable dfxml_writer *xreport, so it is not yet ready to write to report.xml.

To fix this:

  • Move instantiation of xreport way up near the top, being careful not to disrupt behavior in the event of an error or if bulk_extractor is being restarted.
  • Pass the xreport pointer as a new parameter to word_and_context_list::readfile() so that readfile can write the stats directly into report.xml.
  • I recommend the same treatment of passing xreport to any function that prints to stdout wherever the user also wants the output to go into report.xml.

BruceMty avatar Mar 27 '15 00:03 BruceMty

Do we have a test case for this?

simsong avatar Nov 09 '19 20:11 simsong