]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
declare 'key' as const, which avoids a weird memcpy
authorAlan T. DeKok <aland@freeradius.org>
Tue, 6 Apr 2021 12:35:02 +0000 (08:35 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 22 Jul 2021 13:55:24 +0000 (09:55 -0400)
src/main/listen.c

index 724cae1040c5e14789927761d6c825014c782e70..bc0b2a3fe913cd5b62c07c512d3b983cb93498d8 100644 (file)
@@ -3722,7 +3722,7 @@ rad_listen_t *listener_find_byipaddr(fr_ipaddr_t const *ipaddr, uint16_t port, i
 static rbtree_t *coa_tree = NULL;
 
 typedef struct {
-       char            *key;
+       char const      *key;
        rad_listen_t    *first;
 
        pthread_mutex_t mutex;          /* per key, to lower contention */
@@ -3788,7 +3788,7 @@ void listen_coa_add(rad_listen_t *this, char const *key)
        /*
         *      Find the key.  If we can't find it, then create it.
         */
-       memcpy(&my_key.key, &key, sizeof(key)); /* const issues */
+       my_key.key = key;
 
 retry:
        coa_key = rbtree_finddata(coa_tree, &my_key);