Skip to content
Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1565 from Whissi/fix-format-security-issue-in-zmq…
…-modules

Fix format security issue in zmq3 modules
  • Loading branch information
rgerhards committed Jun 1, 2017
2 parents fab2e39 + 3f8a235 commit 062d0c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions contrib/imzmq3/imzmq3.c
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions contrib/omzmq3/omzmq3.c
Expand Up @@ -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);
Expand Down

0 comments on commit 062d0c6

Please sign in to comment.