Fix size calculation, log unhandled amount.
[exim.git] / src / src / smtp_in.c
index 91b1c7e6dd96b6114dac0c55a5cca9fee1ce0352..053b6aa26f8dfd337c9d68b583042b1f9588e803 100644 (file)
@@ -1117,8 +1117,9 @@ else if (ret >= 8 && memcmp(hdr.v1.line, "PROXY", 5) == 0)
     goto proxyfail;
     }
   *end = '\0'; /* Terminate the string */
-  size = end + 2 - hdr.v1.line; /* Skip header + CRLF */
+  size = end + 2 - p; /* Skip header + CRLF */
   DEBUG(D_receive) debug_printf("Detected PROXYv1 header\n");
+  DEBUG(D_receive) debug_printf("Bytes read not within PROXY header: %ld\n", ret - size);
   /* Step through the string looking for the required fields. Ensure
      strict adherence to required formatting, exit for any error. */
   p += 5;