summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2017-10-20 23:21:27 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2017-10-20 23:53:14 +0100
commite5ab0ba9eb0f4424dfa31128f36b27b6769d7795 (patch)
tree945928c9cb32704057c3a15dfcade18869238d03 /src
parentcb63e7df39c6b128c36754295490316a18104fd2 (diff)
Use safer routine for possibly-overlapping copy
Fixes a logging bug seen on aarch64
Diffstat (limited to 'src')
-rw-r--r--src/src/transports/smtp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index 016f9783f..ca06bf6bd 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -1820,7 +1820,7 @@ goto SEND_QUIT;
errno = ERRNO_SMTPCLOSED;
goto EHLOHELO_FAILED;
}
- Ustrncpy(sx->buffer, rsp, sizeof(sx->buffer)/2);
+ memmove(sx->buffer, rsp, Ustrlen(rsp));
goto RESPONSE_FAILED;
}
}
@@ -2176,11 +2176,6 @@ return OK;
sx->send_quit = FALSE;
goto FAILED;
- /* This label is jumped to directly when a TLS negotiation has failed,
- or was not done for a host for which it is required. Values will be set
- in message and errno, and setting_up will always be true. Treat as
- a temporary error. */
-
EHLOHELO_FAILED:
code = '4';
message = string_sprintf("Remote host closed connection in response to %s"
@@ -2188,6 +2183,11 @@ return OK;
sx->send_quit = FALSE;
goto FAILED;
+ /* This label is jumped to directly when a TLS negotiation has failed,
+ or was not done for a host for which it is required. Values will be set
+ in message and errno, and setting_up will always be true. Treat as
+ a temporary error. */
+
#ifdef SUPPORT_TLS
TLS_FAILED:
code = '4';