diff options
author | Phil Pennock <pdp@exim.org> | 2017-01-30 18:38:16 -0500 |
---|---|---|
committer | Phil Pennock <pdp@exim.org> | 2017-01-30 18:38:16 -0500 |
commit | a5d4db406e8868eceb883df6dee15b3553d563ea (patch) | |
tree | 2b74a96532bd38f3eb33ef4c65d064f634640b43 | |
parent | b6040544759110aa97f93e9ba0dd8232cd5e5188 (diff) |
Fix size calculation, log unhandled amount.
We did a `string_copy()` so `hdr.v1.line` is not the right base for an
accurate size. Fix.
Log unhanded amount. For clients waiting on the server before sending,
this has to be 0. For clients speaking first (TLS) this can be
non-zero.
-rw-r--r-- | src/src/smtp_in.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index 91b1c7e6d..053b6aa26 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -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; |