From 102f0cd29db5400e69d25d577859580f4d66b832 Mon Sep 17 00:00:00 2001 From: gilles Date: Sat, 19 Apr 2014 16:56:34 +0000 Subject: [PATCH] (void) cast strlcpy() calls that cannot truncate (copies between buffers of same size with a truncation check on the initial buffer) --- usr.sbin/smtpd/smtp_session.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c index 7fd90d870d4..83c2eb96f09 100644 --- a/usr.sbin/smtpd/smtp_session.c +++ b/usr.sbin/smtpd/smtp_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp_session.c,v 1.204 2014/04/19 16:52:20 gilles Exp $ */ +/* $OpenBSD: smtp_session.c,v 1.205 2014/04/19 16:56:34 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade @@ -658,10 +658,10 @@ smtp_mfa_response(struct smtp_session *s, int msg, int status, uint32_t code, if (s->listener->flags & F_SMTPS) { req_ca_cert.reqid = s->id; if (s->listener->pki_name[0]) - strlcpy(req_ca_cert.name, s->listener->pki_name, + (void)strlcpy(req_ca_cert.name, s->listener->pki_name, sizeof req_ca_cert.name); else - strlcpy(req_ca_cert.name, s->smtpname, + (void)strlcpy(req_ca_cert.name, s->smtpname, sizeof req_ca_cert.name); m_compose(p_lka, IMSG_SMTP_SSL_INIT, 0, 0, -1, &req_ca_cert, sizeof(req_ca_cert)); @@ -905,10 +905,10 @@ smtp_io(struct io *io, int evt) if (s->state == STATE_TLS) { req_ca_cert.reqid = s->id; if (s->listener->pki_name[0]) - strlcpy(req_ca_cert.name, s->listener->pki_name, + (void)strlcpy(req_ca_cert.name, s->listener->pki_name, sizeof req_ca_cert.name); else - strlcpy(req_ca_cert.name, s->smtpname, + (void)strlcpy(req_ca_cert.name, s->smtpname, sizeof req_ca_cert.name); m_compose(p_lka, IMSG_SMTP_SSL_INIT, 0, 0, -1, &req_ca_cert, sizeof(req_ca_cert)); -- 2.20.1