]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* Follow the same logic that is used for calculating the length
authorRuediger Pluem <rpluem@apache.org>
Wed, 18 Aug 2021 14:35:41 +0000 (14:35 +0000)
committerRuediger Pluem <rpluem@apache.org>
Wed, 18 Aug 2021 14:35:41 +0000 (14:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1892418 13f79535-47bb-0310-9956-ffa450edef68

server/util.c

index e44e39afe3ed9d74aa35bfdaee11a033c93f5b1c..6bc5063bc399acba52dd15dfa9df10cde7efe84e 100644 (file)
@@ -2621,13 +2621,12 @@ AP_DECLARE(char *) ap_escape_quotes(apr_pool_t *p, const char *instring)
      * in front of every " that doesn't already have one.
      */
     while (*inchr != '\0') {
-        while ((*inchr == '\\') && (inchr[1] != '\0')) {
-            *outchr++ = *inchr++;
-            *outchr++ = *inchr++;
-        }
         if (*inchr == '"') {
             *outchr++ = '\\';
         }
+        if ((*inchr == '\\') && (inchr[1] != '\0')) {
+            *outchr++ = *inchr++;
+        }
         if (*inchr != '\0') {
             *outchr++ = *inchr++;
         }