|
|
b045b9 |
From cfa194289ee0c9d26d5775f0b67cf9b481bf357f Mon Sep 17 00:00:00 2001
|
|
|
b045b9 |
From: Mark Reynolds <mreynolds@redhat.com>
|
|
|
b045b9 |
Date: Fri, 12 Jan 2018 10:37:18 -0500
|
|
|
b045b9 |
Subject: [PATCH] Ticket 49532 - coverity issues - fix compiler warnings &
|
|
|
b045b9 |
clang issues
|
|
|
b045b9 |
|
|
|
b045b9 |
Description: Fixed all the warnings
|
|
|
b045b9 |
|
|
|
b045b9 |
https://pagure.io/389-ds-base/issue/49532
|
|
|
b045b9 |
|
|
|
b045b9 |
Reviewed by: tbordaz(Thanks!)
|
|
|
b045b9 |
|
|
|
b045b9 |
(cherry picked from commit 05907ae05c8a88a64b86747879c002d55d356673)
|
|
|
b045b9 |
---
|
|
|
b045b9 |
ldap/servers/slapd/back-ldbm/idl_set.c | 4 ++--
|
|
|
b045b9 |
ldap/servers/slapd/control.c | 2 +-
|
|
|
b045b9 |
src/nunc-stans/ns/ns_thrpool.c | 7 ++++++-
|
|
|
b045b9 |
3 files changed, 9 insertions(+), 4 deletions(-)
|
|
|
b045b9 |
|
|
|
b045b9 |
diff --git a/ldap/servers/slapd/back-ldbm/idl_set.c b/ldap/servers/slapd/back-ldbm/idl_set.c
|
|
|
b045b9 |
index b68e7ab76..f9a900f1f 100644
|
|
|
b045b9 |
--- a/ldap/servers/slapd/back-ldbm/idl_set.c
|
|
|
b045b9 |
+++ b/ldap/servers/slapd/back-ldbm/idl_set.c
|
|
|
b045b9 |
@@ -270,7 +270,7 @@ idl_set_union(IDListSet *idl_set, backend *be)
|
|
|
b045b9 |
* Allocate a new set based on the size of our sets.
|
|
|
b045b9 |
*/
|
|
|
b045b9 |
IDList *result_list = idl_alloc(idl_set->total_size);
|
|
|
b045b9 |
- IDList *idl = idl_set->head;
|
|
|
b045b9 |
+ IDList *idl = NULL;
|
|
|
b045b9 |
IDList *idl_del = NULL;
|
|
|
b045b9 |
IDList *prev_idl = NULL;
|
|
|
b045b9 |
NIDS last_min = 0;
|
|
|
b045b9 |
@@ -398,7 +398,7 @@ idl_set_intersect(IDListSet *idl_set, backend *be)
|
|
|
b045b9 |
* we don't care if we have allids here, because we'll ignore it anyway.
|
|
|
b045b9 |
*/
|
|
|
b045b9 |
result_list = idl_alloc(idl_set->minimum->b_nids);
|
|
|
b045b9 |
- IDList *idl = idl_set->head;
|
|
|
b045b9 |
+ IDList *idl = NULL;
|
|
|
b045b9 |
|
|
|
b045b9 |
/* The previous value we inserted. */
|
|
|
b045b9 |
NIDS last_min = 0;
|
|
|
b045b9 |
diff --git a/ldap/servers/slapd/control.c b/ldap/servers/slapd/control.c
|
|
|
b045b9 |
index 91d8abb95..366ec7897 100644
|
|
|
b045b9 |
--- a/ldap/servers/slapd/control.c
|
|
|
b045b9 |
+++ b/ldap/servers/slapd/control.c
|
|
|
b045b9 |
@@ -337,7 +337,7 @@ get_ldapmessage_controls_ext(
|
|
|
b045b9 |
slapi_pblock_set(pb, SLAPI_MANAGEDSAIT, &ctrl_not_found);
|
|
|
b045b9 |
slapi_pblock_set(pb, SLAPI_PWPOLICY, &ctrl_not_found);
|
|
|
b045b9 |
slapi_log_err(SLAPI_LOG_CONNS, "get_ldapmessage_controls_ext", "Warning: conn=%" PRIu64 " op=%d contains an empty list of controls\n",
|
|
|
b045b9 |
- pb_conn->c_connid, pb_op->o_opid);
|
|
|
b045b9 |
+ pb_conn ? pb_conn->c_connid : -1, pb_op ? pb_op->o_opid : -1);
|
|
|
b045b9 |
} else {
|
|
|
b045b9 |
/* len, ber_len_t is uint, not int, cannot be != -1, may be better to remove this check. */
|
|
|
b045b9 |
if ((tag != LBER_END_OF_SEQORSET) && (len != -1)) {
|
|
|
b045b9 |
diff --git a/src/nunc-stans/ns/ns_thrpool.c b/src/nunc-stans/ns/ns_thrpool.c
|
|
|
b045b9 |
index 1d8bb03f1..d95b0c38b 100644
|
|
|
b045b9 |
--- a/src/nunc-stans/ns/ns_thrpool.c
|
|
|
b045b9 |
+++ b/src/nunc-stans/ns/ns_thrpool.c
|
|
|
b045b9 |
@@ -1587,7 +1587,12 @@ ns_thrpool_shutdown(struct ns_thrpool_t *tp)
|
|
|
b045b9 |
*/
|
|
|
b045b9 |
for (size_t i = 0; i < tp->thread_count; i++) {
|
|
|
b045b9 |
ns_result_t result = ns_add_shutdown_job(tp);
|
|
|
b045b9 |
- PR_ASSERT(result == NS_SUCCESS);
|
|
|
b045b9 |
+ if (result != NS_SUCCESS) {
|
|
|
b045b9 |
+#ifdef DEBUG
|
|
|
b045b9 |
+ ns_log(LOG_DEBUG, "ns_thrpool_shutdown - Failed to add shutdown job: error (%d)\n", result);
|
|
|
b045b9 |
+#endif
|
|
|
b045b9 |
+ PR_ASSERT(0);
|
|
|
b045b9 |
+ }
|
|
|
b045b9 |
}
|
|
|
b045b9 |
/* Make sure all threads are woken up to their shutdown jobs. */
|
|
|
b045b9 |
pthread_mutex_lock(&(tp->work_q_lock));
|
|
|
b045b9 |
--
|
|
|
b045b9 |
2.13.6
|
|
|
b045b9 |
|