Do not forward more than the remaining data to downstream UDP analyzer

This fixes a bug introduced in 2b9de839b0
/ GH-3080, which causes UDP padding to be sent to UDP based analyzers.

Fixes GH-3205.
This commit is contained in:
Johanna Amann 2023-07-27 13:35:41 +01:00
parent bd75d72f3f
commit a391367c36
3 changed files with 16 additions and 1 deletions

View file

@ -226,7 +226,7 @@ void UDPAnalyzer::DeliverPacket(Connection* c, double t, bool is_orig, int remai
ForwardPacket(std::min(len, remaining), data, pkt, ntohs(c->RespPort()));
// Forward any data through session-analysis, too.
adapter->ForwardPacket(remaining, data, is_orig, -1, ip.get(), pkt->cap_len);
adapter->ForwardPacket(std::min(len, remaining), data, is_orig, -1, ip.get(), pkt->cap_len);
}
bool UDPAnalyzer::ValidateChecksum(const IP_Hdr* ip, const udphdr* up, int len)