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 1/2] imzmq3: Fix building with -Werror=format-security
---
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 9ca178710..d32dcbc26 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,
From 3f8a235d17d62e93f9492151c81001c7407f32f9 Mon Sep 17 00:00:00 2001
From: Thomas Deutschmann <whissi@whissi.de>
Date: Wed, 17 May 2017 23:07:40 +0200
Subject: [PATCH 2/2] omzmq3: Fix building with -Werror=format-security
---
contrib/omzmq3/omzmq3.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/omzmq3/omzmq3.c b/contrib/omzmq3/omzmq3.c
index 778e151e0..ceb461c6d 100644
--- a/contrib/omzmq3/omzmq3.c
+++ b/contrib/omzmq3/omzmq3.c
@@ -242,14 +242,14 @@ static rsRetVal initZMQ(instanceData* pData) {
if (pData->action == ACTION_BIND) {
/* bind asserts, so no need to test return val here
which isn't the greatest api -- oh well */
- if(-1 == zsocket_bind(pData->socket, (char*)pData->description)) {
+ if(-1 == zsocket_bind(pData->socket, "%s", (char*)pData->description)) {
errmsg.LogError(0, RS_RET_NO_ERRCODE, "omzmq3: bind failed for %s: %s",
pData->description, zmq_strerror(errno));
ABORT_FINALIZE(RS_RET_NO_ERRCODE);
}
DBGPRINTF("omzmq3: bind to %s successful\n",pData->description);
} else {
- if(-1 == zsocket_connect(pData->socket, (char*)pData->description)) {
+ if(-1 == zsocket_connect(pData->socket, "%s", (char*)pData->description)) {
errmsg.LogError(0, RS_RET_NO_ERRCODE, "omzmq3: connect failed for %s: %s",
pData->description, zmq_strerror(errno));
ABORT_FINALIZE(RS_RET_NO_ERRCODE);