]> 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>
Tue, 6 Apr 2021 12:35:02 +0000 (08:35 -0400)
src/main/listen.c

index 7aa539d1efdc3732f3c2a334b11556ea0a21748b..e14d86608d4b33226a6a1cf2c067183643ce460b 100644 (file)
@@ -3714,7 +3714,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 */
@@ -3780,7 +3780,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);