Fix Proxy Protocol v2 handling
[exim.git] / src / src / expand.c
index 64a3a86e6156a5b3282dc475f67fa0023de579d8..7e8c2b49d471df954e78cb14a2d5db1e970272e7 100644 (file)
@@ -468,6 +468,7 @@ static var_entry var_table[] = {
 #endif
 #ifdef EXPERIMENTAL_DMARC
   { "dmarc_ar_header",     vtype_stringptr,   &dmarc_ar_header },
 #endif
 #ifdef EXPERIMENTAL_DMARC
   { "dmarc_ar_header",     vtype_stringptr,   &dmarc_ar_header },
+  { "dmarc_domain_policy", vtype_stringptr,   &dmarc_domain_policy },
   { "dmarc_status",        vtype_stringptr,   &dmarc_status },
   { "dmarc_status_text",   vtype_stringptr,   &dmarc_status_text },
   { "dmarc_used_domain",   vtype_stringptr,   &dmarc_used_domain },
   { "dmarc_status",        vtype_stringptr,   &dmarc_status },
   { "dmarc_status_text",   vtype_stringptr,   &dmarc_status_text },
   { "dmarc_used_domain",   vtype_stringptr,   &dmarc_used_domain },
@@ -564,6 +565,8 @@ static var_entry var_table[] = {
   { "proxy_host_address",  vtype_stringptr,   &proxy_host_address },
   { "proxy_host_port",     vtype_int,         &proxy_host_port },
   { "proxy_session",       vtype_bool,        &proxy_session },
   { "proxy_host_address",  vtype_stringptr,   &proxy_host_address },
   { "proxy_host_port",     vtype_int,         &proxy_host_port },
   { "proxy_session",       vtype_bool,        &proxy_session },
+  { "proxy_target_address",vtype_stringptr,   &proxy_target_address },
+  { "proxy_target_port",   vtype_int,         &proxy_target_port },
 #endif
   { "prvscheck_address",   vtype_stringptr,   &prvscheck_address },
   { "prvscheck_keynum",    vtype_stringptr,   &prvscheck_keynum },
 #endif
   { "prvscheck_address",   vtype_stringptr,   &prvscheck_address },
   { "prvscheck_keynum",    vtype_stringptr,   &prvscheck_keynum },
@@ -6189,8 +6192,13 @@ while (*s != 0)
              }
            if((c & 0xe0) == 0xc0)              /* 2-byte sequence */
              {
              }
            if((c & 0xe0) == 0xc0)              /* 2-byte sequence */
              {
-             bytes_left = 1;
-             codepoint = c & 0x1f;
+             if(c == 0xc0 || c == 0xc1)        /* 0xc0 and 0xc1 are illegal */
+               complete = -1;
+             else
+               {
+                 bytes_left = 1;
+                 codepoint = c & 0x1f;
+               }
              }
            else if((c & 0xf0) == 0xe0)         /* 3-byte sequence */
              {
              }
            else if((c & 0xf0) == 0xe0)         /* 3-byte sequence */
              {