summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/mail.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mbbsd/mail.c b/mbbsd/mail.c
index aafd9f16..61294d7e 100644
--- a/mbbsd/mail.c
+++ b/mbbsd/mail.c
@@ -1987,9 +1987,10 @@ bsmtp(const char *fpath, const char *title, const char *rcpt, const char *from)
int len;
if (strchr(rcpt, '@')) {
+ strlcpy(hacker, rcpt, sizeof(hacker));
len = ptr - rcpt;
- memcpy(hacker, rcpt, len);
- hacker[len] = '\0';
+ if (0 <= len && len < sizeof(hacker))
+ hacker[len] = '\0';
} else
strlcpy(hacker, rcpt, sizeof(hacker));
return send_inner_mail(fpath, title, hacker);