summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgilles <gilles@openbsd.org>2014-04-19 17:45:05 +0000
committergilles <gilles@openbsd.org>2014-04-19 17:45:05 +0000
commitdd7aa8c7d32fab51fa4df98f404f5a8f3421a425 (patch)
tree1dd8cfb2f0a6a55100c387a927fbc37429122c7d
parent(void) cast snprintf calls that cannot truncate or for which earlier checks (diff)
downloadwireguard-openbsd-dd7aa8c7d32fab51fa4df98f404f5a8f3421a425.tar.xz
wireguard-openbsd-dd7aa8c7d32fab51fa4df98f404f5a8f3421a425.zip
(void) cast snprintf() call used to craft fatalx() message from within
smtpd, buffer is large enough and truncation harmless, we want to avoid memory allocation in that case and use a best-effort
-rw-r--r--usr.sbin/smtpd/mproc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/mproc.c b/usr.sbin/smtpd/mproc.c
index 4be3d61c1a2..a5223d61e0c 100644
--- a/usr.sbin/smtpd/mproc.c
+++ b/usr.sbin/smtpd/mproc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mproc.c,v 1.7 2013/12/26 17:25:32 eric Exp $ */
+/* $OpenBSD: mproc.c,v 1.8 2014/04/19 17:45:05 gilles Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@faurot.net>
@@ -424,7 +424,7 @@ m_error(const char *error)
{
char buf[512];
- snprintf(buf, sizeof buf, "%s: %s: %s",
+ (void)snprintf(buf, sizeof buf, "%s: %s: %s",
proc_name(smtpd_process),
imsg_to_str(current->hdr.type),
error);