1
0
mirror of https://github.com/pavel-odintsov/fastnetmon synced 2024-11-24 02:46:36 +01:00

Add sanity check for netflow v5

This commit is contained in:
Pavel Odintsov 2015-04-27 10:19:05 +03:00
parent 701dd728b4
commit 60e3907e30

@ -772,7 +772,10 @@ void process_netflow_packet_v5(u_int8_t *packet, u_int len) {
size_t offset = NF5_PACKET_SIZE(i);
struct NF5_FLOW* nf5_flow = (struct NF5_FLOW *)(packet + offset);
// TODO: add check for sure "packet+offset + sizeof(struct NF5_FLOW) is not more than len"
/* Check packet bounds */
if (offset + sizeof(struct NF5_FLOW) > len) {
logger<< log4cpp::Priority::ERROR<<"Error! You will try to read outside the packet";
}
// convert netflow to simple packet form
simple_packet current_packet;