]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
check counter before accessing array. CID #1504030
authorNick Porter <nick@portercomputing.co.uk>
Tue, 12 Apr 2022 15:31:01 +0000 (16:31 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Tue, 12 Apr 2022 15:31:01 +0000 (16:31 +0100)
src/lib/ldap/connection.c

index 190cf64fc762bd8cb352e6758dca745a602ca4bf..9d2a1bf147cd9c5c481f042cc9a63e135e7c6307 100644 (file)
@@ -613,7 +613,7 @@ static fr_connection_t *ldap_trunk_connection_alloc(fr_trunk_connection_t *tconn
 
 #define POPULATE_LDAP_CONTROLS(_dest, _src) do { \
        int i; \
-       for (i = 0; (_src[i].control) && (i < LDAP_MAX_CONTROLS); i++) { \
+       for (i = 0; (i < LDAP_MAX_CONTROLS) && (_src[i].control); i++) { \
                _dest[i] = _src[i].control; \
        } \
        _dest[i] = NULL; \