]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
check for invalid MS-CHAP attributes
authorAlan T. DeKok <aland@freeradius.org>
Sat, 7 Mar 2026 14:19:03 +0000 (09:19 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 7 Mar 2026 14:19:03 +0000 (09:19 -0500)
src/modules/rlm_mschap/opendir.c

index 44b0a1fbfba6f2ec6cb8be08fb893740880ee0e4..b021683b77a36e7d805d5d79a4ae72bbe6dbc202 100644 (file)
@@ -256,6 +256,10 @@ unlang_action_t od_mschap_auth(unlang_result_t *p_result, request_t *request, fr
 #endif
 
        response = fr_pair_find_by_da_nested(&request->request_pairs, NULL, tmpl_attr_tail_da(env_data->chap2_response));
+       if (!response) {
+               RERROR("No MS-CHAP2-Response in request");
+               RETURN_UNLANG_FAIL;
+       }
 
        username_string = talloc_array(request, char, usernamepair->vp_length + 1);
        if (!username_string) RETURN_UNLANG_FAIL;