Don't leave 'vp' pointing to a deleted attribute
authoraland <aland>
Thu, 8 Feb 2007 10:24:35 +0000 (10:24 +0000)
committeraland <aland>
Thu, 8 Feb 2007 10:24:35 +0000 (10:24 +0000)
src/modules/rlm_pap/rlm_pap.c

index 3d3a40a..46556f4 100644 (file)
@@ -289,10 +289,12 @@ static int pap_authorize(void *instance, REQUEST *request)
        int auth_type = FALSE;
        int found_pw = FALSE;
        int user_pw = FALSE;
-       VALUE_PAIR *vp;
+       VALUE_PAIR *vp, *next;
        VALUE_PAIR *cleartext_pw = NULL;
 
-       for (vp = request->config_items; vp != NULL; vp = vp->next) {
+       for (vp = request->config_items; vp != NULL; vp = next) {
+               next = vp->next;
+
                switch (vp->attribute) {
                case PW_USER_PASSWORD: /* deprecated */
                        user_pw = TRUE;