[master] 71d8abb Amazing that neither Coverity or FlexeLint complained about the syslog-ism "%m" being used in vsnprintf() via VSB.

Poul-Henning Kamp phk at FreeBSD.org
Thu Sep 14 09:40:06 UTC 2017


commit 71d8abbee9fcc2b3d7862268ea76b79b5a199cd8
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Sep 14 09:37:57 2017 +0000

    Amazing that neither Coverity or FlexeLint complained about the
    syslog-ism "%m" being used in vsnprintf() via VSB.
    
    That said, it would have been damn convenient of %m was also usable
    in *printf(3)...

diff --git a/bin/varnishd/mgt/mgt_cli.c b/bin/varnishd/mgt/mgt_cli.c
index 4d23bba..f00e19a 100644
--- a/bin/varnishd/mgt/mgt_cli.c
+++ b/bin/varnishd/mgt/mgt_cli.c
@@ -622,7 +622,8 @@ Marg_connect(const struct vev *e, int what)
 
 	M_fd = VTCP_connected(M_fd);
 	if (M_fd < 0) {
-		MGT_Complain(C_INFO, "Could not connect to CLI-master: %m");
+		MGT_Complain(C_INFO, "Could not connect to CLI-master: %s",
+			strerror(errno));
 		ma = VTAILQ_FIRST(&m_addr_list);
 		AN(ma);
 		VTAILQ_REMOVE(&m_addr_list, ma, list);


More information about the varnish-commit mailing list