You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2017/07/05 19:44:31 UTC

svn commit: r1800919 - /httpd/httpd/trunk/modules/aaa/mod_auth_digest.c

Author: wrowe
Date: Wed Jul  5 19:44:30 2017
New Revision: 1800919

URL: http://svn.apache.org/viewvc?rev=1800919&view=rev
Log:
Correct string scope to prevent duplicated values for subsequent tokens.


Modified:
    httpd/httpd/trunk/modules/aaa/mod_auth_digest.c

Modified: httpd/httpd/trunk/modules/aaa/mod_auth_digest.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_auth_digest.c?rev=1800919&r1=1800918&r2=1800919&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_auth_digest.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_auth_digest.c Wed Jul  5 19:44:30 2017
@@ -952,13 +952,13 @@ static int get_digest_rec(request_rec *r
 
         /* 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
                     value[vv++] = *auth_line++;
                 }
             }
-            value[vv] = '\0';
         }
+        value[vv] = '\0';
 
         while (auth_line[0] != ',' && auth_line[0] != '\0') {
             auth_line++;