terminate && check VP
[freeradius.git] / src / modules / rlm_eap / rlm_eap.c
index a930d6f..14265ee 100644 (file)
@@ -469,10 +469,12 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authenticate(void *instance, REQUEST *re
                        new = talloc_array(vp, char, vp->vp_length + 1);
 
                        memcpy(new, old, vp->vp_length);
+                       new[vp->length] = '\0';
                        new[vp->length + 1] = '\0';
                        vp->vp_strvalue = new;
 
                        rad_const_free(old);
+                       VERIFY_VP(vp);
                }
        }