Added some checks for the byte buffer allocation in the GTP-U

master
Pedro Alvarez 4 years ago committed by Francisco Paisana
parent cade7c8104
commit ea3c3b1d4f

@ -458,6 +458,10 @@ void gtpu::error_indication(in_addr_t addr, in_port_t port, uint32_t err_teid)
gtpu_header_t header = {}; gtpu_header_t header = {};
unique_byte_buffer_t pdu = make_byte_buffer(); unique_byte_buffer_t pdu = make_byte_buffer();
if (pdu == nullptr) {
logger.error("Could not allocate byte buffer for error indication");
return;
}
// header // header
header.flags = GTPU_FLAGS_VERSION_V1 | GTPU_FLAGS_GTP_PROTOCOL | GTPU_FLAGS_SEQUENCE; header.flags = GTPU_FLAGS_VERSION_V1 | GTPU_FLAGS_GTP_PROTOCOL | GTPU_FLAGS_SEQUENCE;
@ -488,6 +492,10 @@ void gtpu::echo_response(in_addr_t addr, in_port_t port, uint16_t seq)
gtpu_header_t header = {}; gtpu_header_t header = {};
unique_byte_buffer_t pdu = make_byte_buffer(); unique_byte_buffer_t pdu = make_byte_buffer();
if (pdu == nullptr) {
logger.error("Could not allocate byte buffer for echo response");
return;
}
// header // header
header.flags = GTPU_FLAGS_VERSION_V1 | GTPU_FLAGS_GTP_PROTOCOL | GTPU_FLAGS_SEQUENCE; header.flags = GTPU_FLAGS_VERSION_V1 | GTPU_FLAGS_GTP_PROTOCOL | GTPU_FLAGS_SEQUENCE;

Loading…
Cancel
Save