diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-11-16 22:00:29 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-11-16 22:00:29 +0300 |
commit | 3ebceeece2204d3755df1f1cc8210f7e97b6daad (patch) | |
tree | 38c122341dbbb2f1ea1a4c969ad95dda38c1106e /src/lmtp_proto.c | |
parent | c85dd608a568d61e3b24c55b715ad37ceedb7110 (diff) | |
download | rspamd-3ebceeece2204d3755df1f1cc8210f7e97b6daad.tar.gz rspamd-3ebceeece2204d3755df1f1cc8210f7e97b6daad.zip |
Make own strlcpy that does not calculate remaining string length (faster and more safe)
Allow only ASCII symbols in logs, escape control chars
Diffstat (limited to 'src/lmtp_proto.c')
-rw-r--r-- | src/lmtp_proto.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lmtp_proto.c b/src/lmtp_proto.c index b81daf240..de2305924 100644 --- a/src/lmtp_proto.c +++ b/src/lmtp_proto.c @@ -131,7 +131,7 @@ read_lmtp_input_line (struct rspamd_lmtp_proto *lmtp, f_str_t * line) } lmtp->task->helo = memory_pool_alloc (lmtp->task->task_pool, line->len - i + 1); /* Strlcpy makes string null terminated by design */ - g_strlcpy (lmtp->task->helo, c, line->len - i + 1); + rspamd_strlcpy (lmtp->task->helo, c, line->len - i + 1); lmtp->state = LMTP_READ_FROM; if (! out_lmtp_reply (lmtp->task, LMTP_OK, "", "Ok")) { return -1; @@ -203,7 +203,7 @@ read_lmtp_input_line (struct rspamd_lmtp_proto *lmtp, f_str_t * line) } rcpt = memory_pool_alloc (lmtp->task->task_pool, line->len - i + 1); /* Strlcpy makes string null terminated by design */ - g_strlcpy (rcpt, c, line->len - i + 1); + rspamd_strlcpy (rcpt, c, line->len - i + 1); lmtp->task->rcpt = g_list_prepend (lmtp->task->rcpt, rcpt); lmtp->state = LMTP_READ_MESSAGE; if (! out_lmtp_reply (lmtp->task, LMTP_DATA, "", "Enter message, ending with \".\" on a line by itself")) { |