MT#62053 add safeguard against broken port ranges

Change-Id: I5e4fa46b5d75253129e887da8ddbba4fc60702f5
pull/1910/head
Richard Fuchs 10 months ago
parent 2d8f5616e4
commit aec1a0940c

@ -820,6 +820,10 @@ static void __interface_append(struct intf_config *ifa, sockfamily_t *fam, bool
spec = t_hash_table_lookup(__intf_spec_addr_type_hash, &ifa->local_address); spec = t_hash_table_lookup(__intf_spec_addr_type_hash, &ifa->local_address);
if (!spec) { if (!spec) {
if (ifa->port_min == 0 || ifa->port_max == 0 || ifa->port_min > 65535
|| ifa->port_max > 65535 || ifa->port_min > ifa->port_max)
die("Invalid RTP port range (%d > %d)", ifa->port_min, ifa->port_max);
spec = g_slice_alloc0(sizeof(*spec)); spec = g_slice_alloc0(sizeof(*spec));
spec->local_address = ifa->local_address; spec->local_address = ifa->local_address;
spec->port_pool.free_ports = g_new0(ports_list *, ifa->port_max - ifa->port_min + 1); spec->port_pool.free_ports = g_new0(ports_list *, ifa->port_max - ifa->port_min + 1);

Loading…
Cancel
Save