]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Correct string scope to prevent duplicated values for subsequent tokens.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 5 Jul 2017 19:44:30 +0000 (19:44 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 5 Jul 2017 19:44:30 +0000 (19:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1800919 13f79535-47bb-0310-9956-ffa450edef68

modules/aaa/mod_auth_digest.c

index b0a96823da78a5b58e966ea3c3d15c774aafba36..7179f1dc9701016fb386991fc9b8b4635d143c94 100644 (file)
@@ -952,13 +952,13 @@ static int get_digest_rec(request_rec *r, digest_header_rec *resp)
 
         /* find value */
 
+        vv = 0;
         if (auth_line[0] == '=') {
             auth_line++;
             while (apr_isspace(auth_line[0])) {
                 auth_line++;
             }
 
-            vv = 0;
             if (auth_line[0] == '\"') {         /* quoted string */
                 auth_line++;
                 while (auth_line[0] != '\"' && auth_line[0] != '\0') {
@@ -977,8 +977,8 @@ static int get_digest_rec(request_rec *r, digest_header_rec *resp)
                     value[vv++] = *auth_line++;
                 }
             }
-            value[vv] = '\0';
         }
+        value[vv] = '\0';
 
         while (auth_line[0] != ',' && auth_line[0] != '\0') {
             auth_line++;