86baa9
From 5fb390bc2aed0f460e96c0e98dd57ecf01aec01c Mon Sep 17 00:00:00 2001
86baa9
From: Florence Blanc-Renaud <flo@redhat.com>
86baa9
Date: Thu, 21 Mar 2019 13:59:32 +0100
86baa9
Subject: [PATCH] Coverity: fix issue in ipa_extdom_extop.c
86baa9
86baa9
Coverity found the following issue:
86baa9
Error: BAD_COMPARE (CWE-697): [#def1]
86baa9
freeipa-4.6.5/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_extop.c:121: null_misuse: Comparing pointer "threadnumber" against "NULL" using anything besides "==" or "!=" is likely to be incorrect.
86baa9
86baa9
The comparison is using the pointer while it should use the pointed value.
86baa9
86baa9
Fixes: https://pagure.io/freeipa/issue/7884
86baa9
Reviewed-By: Christian Heimes <cheimes@redhat.com>
86baa9
---
86baa9
 daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_extop.c | 2 +-
86baa9
 1 file changed, 1 insertion(+), 1 deletion(-)
86baa9
86baa9
diff --git a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_extop.c b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_extop.c
86baa9
index 3abaa411d2873dedb27ac83bc53d82677577e5b5..10d3f86ebad920fb9c051aa428cbd675b682f14a 100644
86baa9
--- a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_extop.c
86baa9
+++ b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_extop.c
86baa9
@@ -118,7 +118,7 @@ static int ipa_get_threadnumber(Slapi_ComponentId *plugin_id, size_t *threadnumb
86baa9
     *threadnumber = slapi_entry_attr_get_uint(search_entries[0],
86baa9
                                               NSSLAPD_THREADNUMBER);
86baa9
 
86baa9
-    if (threadnumber <= 0) {
86baa9
+    if (*threadnumber <= 0) {
86baa9
         LOG_FATAL("No thread number found.\n");
86baa9
         ret = LDAP_OPERATIONS_ERROR;
86baa9
         goto done;
86baa9
-- 
86baa9
2.20.1
86baa9