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