From 6bc4aa975a83abed43d734299ce76cd9e1a14aec Mon Sep 17 00:00:00 2001
From: Thomas Deutschmann <whissi@whissi.de>
Date: Wed, 17 May 2017 23:05:24 +0200
Subject: [PATCH] imzmq3: Fix building with -Werror=format-security

Reference: https://nvd.nist.gov/vuln/detail/CVE-2017-12588

CVE: 2017-12588

Upstream-Status: Backport
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 contrib/imzmq3/imzmq3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/imzmq3/imzmq3.c b/contrib/imzmq3/imzmq3.c
index 9ca17871..d32dcbc2 100644
--- a/contrib/imzmq3/imzmq3.c
+++ b/contrib/imzmq3/imzmq3.c
@@ -403,7 +403,7 @@ static rsRetVal createSocket(instanceConf_t* info, void** sock) {
 
     /* Do the bind/connect... */
     if (info->action==ACTION_CONNECT) {
-        rv = zsocket_connect(*sock, info->description);
+        rv = zsocket_connect(*sock, "%s", info->description);
         if (rv == -1) {
             errmsg.LogError(0,
                             RS_RET_INVALID_PARAMS,
@@ -413,7 +413,7 @@ static rsRetVal createSocket(instanceConf_t* info, void** sock) {
         }
         DBGPRINTF("imzmq3: connect for %s successful\n",info->description);
     } else {
-        rv = zsocket_bind(*sock, info->description);
+        rv = zsocket_bind(*sock, "%s", info->description);
         if (rv == -1) {
             errmsg.LogError(0,
                             RS_RET_INVALID_PARAMS,
-- 
2.13.0

