diff options
author | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2021-05-18 18:59:39 +0200 |
---|---|---|
committer | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2021-05-18 19:01:55 +0200 |
commit | aa665d8820b7334e7b3964e4354a0cb7ae7f4bd3 (patch) | |
tree | f463dc804926da0e816b55108372a02e55105237 | |
parent | 2aebe23c066862069cb43e5487276a5bdd89e1c1 (diff) | |
download | psmq-aa665d8820b7334e7b3964e4354a0cb7ae7f4bd3.tar.gz psmq-aa665d8820b7334e7b3964e4354a0cb7ae7f4bd3.tar.bz2 psmq-aa665d8820b7334e7b3964e4354a0cb7ae7f4bd3.zip |
lib, src: fix couple possible uninitialized variables
no_ci
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
-rw-r--r-- | lib/psmq.c | 2 | ||||
-rw-r--r-- | src/broker.c | 3 |
2 files changed, 4 insertions, 1 deletions
@@ -335,6 +335,8 @@ int psmq_init memset(psmq, 0x00, sizeof(struct psmq)); + memset(&mqa, 0x00, sizeof(mqa)); + mqa.mq_msgsize = sizeof(struct psmq_msg); mqa.mq_maxmsg = maxmsg; psmq->qsub = (mqd_t)-1; diff --git a/src/broker.c b/src/broker.c index 6d9bcb4..cb2b215 100644 --- a/src/broker.c +++ b/src/broker.c @@ -402,7 +402,7 @@ static int psmqd_broker_open qname = msg->data; /* open communication line with client */ - qc = mq_open(qname, O_RDWR); + qc = mq_open(qname, O_RDWR, 0600); if (qc == (mqd_t)-1) { /* couldn't open queue provided by client and thus we have @@ -878,6 +878,7 @@ int psmqd_broker_init(void) /* open message queue for control, we will * receive various (like register, publish or * subscribe) requests via it */ + memset(&mqa, 0x00, sizeof(mqa)); mqa.mq_msgsize = sizeof(struct psmq_msg); mqa.mq_maxmsg = g_psmqd_cfg.broker_maxmsg; qctrl = mq_open(g_psmqd_cfg.broker_name, |