Fixes for various btest issues

- Fix handling of truncated ethernet headers, fix core.truncation test output
- Update commit hashes for external private test repo
This commit is contained in:
Tim Wojtulewicz 2020-07-13 16:46:39 -07:00
parent 1c3ded7dd5
commit 08ceea8de1
3 changed files with 25 additions and 17 deletions

View file

@ -17,7 +17,7 @@ std::tuple<zeek::packet_analysis::AnalyzerResult, zeek::packet_analysis::identif
// Assume we're pointing at IP. Just figure out which version.
if ( pdata + sizeof(struct ip) >= packet->GetEndOfData() )
{
packet->Weird("default_ll_analyser_failed");
packet->Weird("packet_analyzer_truncated_header");
return { AnalyzerResult::Failed, 0 };
}

View file

@ -15,6 +15,14 @@ std::tuple<zeek::packet_analysis::AnalyzerResult, zeek::packet_analysis::identif
auto& pdata = packet->cur_pos;
auto end_of_data = packet->GetEndOfData();
// Make sure that we actually got an entire ethernet header before trying
// to pull bytes out of it.
if ( pdata + 16 >= end_of_data )
{
packet->Weird("truncated_ethernet_frame");
return { AnalyzerResult::Failed, 0 };
}
// Skip past Cisco FabricPath to encapsulated ethernet frame.
if ( pdata[12] == 0x89 && pdata[13] == 0x03 )
{