8335b1
diff --git a/modules/aaa/mod_auth_digest.c b/modules/aaa/mod_auth_digest.c
8335b1
index 0ff47f7..cbb4434 100644
8335b1
--- a/modules/aaa/mod_auth_digest.c
8335b1
+++ b/modules/aaa/mod_auth_digest.c
8335b1
@@ -956,13 +956,13 @@ static int get_digest_rec(request_rec *r, digest_header_rec *resp)
8335b1
 
8335b1
         /* find value */
8335b1
 
8335b1
+        vv = 0;
8335b1
         if (auth_line[0] == '=') {
8335b1
             auth_line++;
8335b1
             while (apr_isspace(auth_line[0])) {
8335b1
                 auth_line++;
8335b1
             }
8335b1
 
8335b1
-            vv = 0;
8335b1
             if (auth_line[0] == '\"') {         /* quoted string */
8335b1
                 auth_line++;
8335b1
                 while (auth_line[0] != '\"' && auth_line[0] != '\0') {
8335b1
@@ -981,8 +981,8 @@ static int get_digest_rec(request_rec *r, digest_header_rec *resp)
8335b1
                     value[vv++] = *auth_line++;
8335b1
                 }
8335b1
             }
8335b1
-            value[vv] = '\0';
8335b1
         }
8335b1
+        value[vv] = '\0';
8335b1
 
8335b1
         while (auth_line[0] != ',' && auth_line[0] != '\0') {
8335b1
             auth_line++;