]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
check for more corner cases in radius tracking list
authorAlan T. DeKok <aland@freeradius.org>
Fri, 17 Jul 2026 12:36:02 +0000 (08:36 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 17 Jul 2026 12:36:55 +0000 (08:36 -0400)
src/protocols/radius/list.c

index 35e0ce249a7eb634a4862bfbac3fd3e2862ef006..e88e9a8f8c4da7c81d0c0011d8ee515b5e584637 100644 (file)
@@ -413,7 +413,7 @@ bool fr_packet_list_id_alloc(fr_packet_list_t *pl, int proto,
        int i, j, k, fd, id, start_i, start_j, start_k;
        int src_any = 0;
        int type;
-       fr_packet_socket_t *ps= NULL;
+       fr_packet_socket_t *ps = NULL;
 
        if ((request->socket.inet.dst_ipaddr.af == AF_UNSPEC) ||
            (request->socket.inet.dst_port == 0)) {
@@ -443,6 +443,11 @@ bool fr_packet_list_id_alloc(fr_packet_list_t *pl, int proto,
                return false;
        }
 
+       if (!pl->num_sockets) {
+               fr_strerror_const("No sockets have been added to the packet list");
+               return false;
+       }
+
        /*
         *      FIXME: Go to an LRU system.  This prevents ID reuse
         *      for as long as possible.  The main problem with that