From 4e7f714d1e373f45f7db2efcd5db52f2d7b37f2b Mon Sep 17 00:00:00 2001 From: Pavel Odintsov Date: Mon, 24 Aug 2020 21:57:17 +0100 Subject: [PATCH] Disabled memory pre-allocation in libsflow code to address security issue. Closes: #847 --- src/sflow_plugin/sflow_collector.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/sflow_plugin/sflow_collector.cpp b/src/sflow_plugin/sflow_collector.cpp index a44c6cf6..7283e41b 100644 --- a/src/sflow_plugin/sflow_collector.cpp +++ b/src/sflow_plugin/sflow_collector.cpp @@ -254,7 +254,6 @@ bool process_sflow_flow_sample(uint8_t* data_pointer, uint8_t* flow_record_zone_start = data_pointer + sflow_sample_header_unified_accessor.get_original_payload_length(); vector_tuple_t vector_tuple; - vector_tuple.reserve(sflow_sample_header_unified_accessor.get_number_of_flow_records()); bool padding_found = false; @@ -394,7 +393,6 @@ void parse_sflow_v5_packet(uint8_t* payload_ptr, unsigned int payload_length, ui } vector_sample_tuple_t samples_vector; - samples_vector.reserve(sflow_header_accessor.get_datagram_samples_count()); uint8_t* samples_block_start = payload_ptr + sflow_header_accessor.get_original_payload_length(); @@ -483,7 +481,6 @@ bool process_sflow_counter_sample(uint8_t* data_pointer, } counter_record_sample_vector_t counter_record_sample_vector; - counter_record_sample_vector.reserve(sflow_counter_header_unified_accessor.get_number_of_counter_records()); bool get_all_counter_records_result = get_all_counter_records(counter_record_sample_vector,