]> granicus.if.org Git - apache/commitdiff
Fix segmentation fault in mod_auth_{basic,digest} when no provider is explicitly...
authorPaul Querna <pquerna@apache.org>
Thu, 26 May 2005 20:34:21 +0000 (20:34 +0000)
committerPaul Querna <pquerna@apache.org>
Thu, 26 May 2005 20:34:21 +0000 (20:34 +0000)
Reported by: Ben Collins-Sussman <sussman collab.net>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@178674 13f79535-47bb-0310-9956-ffa450edef68

modules/aaa/mod_auth_basic.c
modules/aaa/mod_auth_digest.c

index b4b48a6f216e199e89b264d8db6101b9f8006950..ee296a44911a010f347b25ec5e00749538623bee 100644 (file)
@@ -232,12 +232,13 @@ static int authenticate_basic_user(request_rec *r)
                 auth_result = AUTH_GENERAL_ERROR;
                 break;
             }
+            apr_table_setn(r->notes, AUTHN_PROVIDER_NAME_NOTE, AUTHN_DEFAULT_PROVIDER);
         }
         else {
             provider = current_provider->provider;
+            apr_table_setn(r->notes, AUTHN_PROVIDER_NAME_NOTE, current_provider->provider_name);
         }
 
-        apr_table_setn(r->notes, AUTHN_PROVIDER_NAME_NOTE, current_provider->provider_name);
 
         auth_result = provider->check_password(r, sent_user, sent_pw);
 
index 7edf320183627f4c3b0946d05ce6377e55fa84a7..9756ac2611fa0e3926d83927a89640b73851b2bc 100644 (file)
@@ -1353,12 +1353,13 @@ static authn_status get_hash(request_rec *r, const char *user,
                 auth_result = AUTH_GENERAL_ERROR;
                 break;
             }
+            apr_table_setn(r->notes, AUTHN_PROVIDER_NAME_NOTE, AUTHN_DEFAULT_PROVIDER);
         }
         else {
             provider = current_provider->provider;
+            apr_table_setn(r->notes, AUTHN_PROVIDER_NAME_NOTE, current_provider->provider_name);
         }
 
-        apr_table_setn(r->notes, AUTHN_PROVIDER_NAME_NOTE, current_provider->provider_name);
 
         /* We expect the password to be md5 hash of user:realm:password */
         auth_result = provider->get_realm_hash(r, user, conf->realm,