Blame SOURCES/0005-Issue-50431-Fix-regression-from-coverity-fix.patch

232633
From 6aa839f96f5ac880d45b0e98ed05445784476745 Mon Sep 17 00:00:00 2001
232633
From: Mark Reynolds <mreynolds@redhat.com>
232633
Date: Thu, 13 Jun 2019 17:55:25 -0400
232633
Subject: [PATCH] Issue 50431 - Fix regression from coverity fix
232633
232633
Description:  Fix a regression from the initial coverity commit
232633
              where we did not allow NULL pointers to set into
232633
              the pblock.  They were false positives reported by
232633
              covscan.
232633
232633
https://pagure.io/389-ds-base/issue/50431
232633
232633
Reviewed by: mreynolds (one line commit rule)
232633
---
232633
 ldap/servers/plugins/acl/acleffectiverights.c | 4 +---
232633
 ldap/servers/plugins/views/views.c            | 4 +---
232633
 ldap/servers/slapd/back-ldbm/vlv_srch.c       | 3 ++-
232633
 ldap/servers/slapd/dse.c                      | 6 ++----
232633
 ldap/servers/slapd/opshared.c                 | 3 +--
232633
 ldap/servers/slapd/plugin_internal_op.c       | 3 +--
232633
 ldap/servers/slapd/plugin_syntax.c            | 4 +---
232633
 7 files changed, 9 insertions(+), 18 deletions(-)
232633
232633
diff --git a/ldap/servers/plugins/acl/acleffectiverights.c b/ldap/servers/plugins/acl/acleffectiverights.c
232633
index 5dd46a064..8a34ac5eb 100644
232633
--- a/ldap/servers/plugins/acl/acleffectiverights.c
232633
+++ b/ldap/servers/plugins/acl/acleffectiverights.c
232633
@@ -1030,9 +1030,7 @@ bailout:
232633
      * slapi_pblock_set() will free any previous data, and
232633
      * pblock_done() will free SLAPI_PB_RESULT_TEXT.
232633
      */
232633
-    if (gerstr) {
232633
-        slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, gerstr);
232633
-    }
232633
+    slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, gerstr);
232633
 
232633
     if (!iscritical) {
232633
         /*
232633
diff --git a/ldap/servers/plugins/views/views.c b/ldap/servers/plugins/views/views.c
232633
index 5d8464761..64e305a3f 100644
232633
--- a/ldap/servers/plugins/views/views.c
232633
+++ b/ldap/servers/plugins/views/views.c
232633
@@ -1760,9 +1760,7 @@ view_search_rewrite_callback(Slapi_PBlock *pb)
232633
 #endif
232633
 
232633
     /* make it happen */
232633
-    if (outFilter) {
232633
-        slapi_pblock_set(pb, SLAPI_SEARCH_FILTER, outFilter);
232633
-    }
232633
+    slapi_pblock_set(pb, SLAPI_SEARCH_FILTER, outFilter);
232633
 
232633
     ret = -2;
232633
 
232633
diff --git a/ldap/servers/slapd/back-ldbm/vlv_srch.c b/ldap/servers/slapd/back-ldbm/vlv_srch.c
232633
index 1ac3e009e..65b876647 100644
232633
--- a/ldap/servers/slapd/back-ldbm/vlv_srch.c
232633
+++ b/ldap/servers/slapd/back-ldbm/vlv_srch.c
232633
@@ -168,8 +168,9 @@ vlvSearch_init(struct vlvSearch *p, Slapi_PBlock *pb, const Slapi_Entry *e, ldbm
232633
 
232633
             /* switch context back to the DSE backend */
232633
             slapi_pblock_set(pb, SLAPI_BACKEND, oldbe);
232633
-            if (oldbe)
232633
+            if (oldbe) {
232633
                 slapi_pblock_set(pb, SLAPI_PLUGIN, oldbe->be_database);
232633
+            }
232633
         }
232633
 
232633
         /* make (&(parentid=idofbase)(|(originalfilter)(objectclass=referral))) */
232633
diff --git a/ldap/servers/slapd/dse.c b/ldap/servers/slapd/dse.c
232633
index 125684329..8f2a14c9a 100644
232633
--- a/ldap/servers/slapd/dse.c
232633
+++ b/ldap/servers/slapd/dse.c
232633
@@ -2530,8 +2530,7 @@ dse_delete(Slapi_PBlock *pb) /* JCM There should only be one exit point from thi
232633
     dse_call_callback(pdse, pb, SLAPI_OPERATION_DELETE, DSE_FLAG_POSTOP, ec, NULL, &returncode, returntext);
232633
 done:
232633
     slapi_pblock_get(pb, SLAPI_DELETE_BEPOSTOP_ENTRY, &orig_entry);
232633
-    if (ec)
232633
-        slapi_pblock_set(pb, SLAPI_DELETE_BEPOSTOP_ENTRY, ec);
232633
+    slapi_pblock_set(pb, SLAPI_DELETE_BEPOSTOP_ENTRY, ec);
232633
     /* make sure OPRETURN and RESULT_CODE are set */
232633
     slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &rc);
232633
     if (returncode || rc) {
232633
@@ -2572,8 +2571,7 @@ done:
232633
             rc = LDAP_UNWILLING_TO_PERFORM;
232633
         }
232633
     }
232633
-    if (orig_entry)
232633
-        slapi_pblock_set(pb, SLAPI_DELETE_BEPOSTOP_ENTRY, orig_entry);
232633
+    slapi_pblock_set(pb, SLAPI_DELETE_BEPOSTOP_ENTRY, orig_entry);
232633
     slapi_send_ldap_result(pb, returncode, NULL, returntext, 0, NULL);
232633
     return dse_delete_return(returncode, ec);
232633
 }
232633
diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c
232633
index dac42eb13..dd6917363 100644
232633
--- a/ldap/servers/slapd/opshared.c
232633
+++ b/ldap/servers/slapd/opshared.c
232633
@@ -998,8 +998,7 @@ free_and_return_nolock:
232633
         slapi_sdn_free(&sdn;;
232633
     }
232633
     slapi_sdn_free(&basesdn);
232633
-    if (orig_sdn)
232633
-        slapi_pblock_set(pb, SLAPI_SEARCH_TARGET_SDN, orig_sdn);
232633
+    slapi_pblock_set(pb, SLAPI_SEARCH_TARGET_SDN, orig_sdn);
232633
 
232633
     slapi_ch_free_string(&proxydn);
232633
     slapi_ch_free_string(&proxystr);
232633
diff --git a/ldap/servers/slapd/plugin_internal_op.c b/ldap/servers/slapd/plugin_internal_op.c
232633
index 622daffdb..9da266b61 100644
232633
--- a/ldap/servers/slapd/plugin_internal_op.c
232633
+++ b/ldap/servers/slapd/plugin_internal_op.c
232633
@@ -368,8 +368,7 @@ seq_internal_callback_pb(Slapi_PBlock *pb, void *callback_data, plugin_result_ca
232633
     slapi_pblock_set(pb, SLAPI_BACKEND, be);
232633
     slapi_pblock_set(pb, SLAPI_PLUGIN, be->be_database);
232633
     slapi_pblock_set(pb, SLAPI_SEQ_ATTRNAME, attrname);
232633
-    if (val)
232633
-        slapi_pblock_set(pb, SLAPI_SEQ_VAL, val);
232633
+    slapi_pblock_set(pb, SLAPI_SEQ_VAL, val);
232633
     slapi_pblock_set(pb, SLAPI_REQCONTROLS, controls);
232633
 
232633
     /* set actions taken to process the operation */
232633
diff --git a/ldap/servers/slapd/plugin_syntax.c b/ldap/servers/slapd/plugin_syntax.c
232633
index dc7106da5..e208442d5 100644
232633
--- a/ldap/servers/slapd/plugin_syntax.c
232633
+++ b/ldap/servers/slapd/plugin_syntax.c
232633
@@ -247,9 +247,7 @@ plugin_call_syntax_filter_sub_sv(
232633
             Operation *op = NULL;
232633
             /* to pass SLAPI_SEARCH_TIMELIMIT & SLAPI_OPINITATED_TIME */
232633
             slapi_pblock_get(pb, SLAPI_OPERATION, &op);
232633
-            if (op) {
232633
-                slapi_pblock_set(pipb, SLAPI_OPERATION, op);
232633
-            }
232633
+            slapi_pblock_set(pipb, SLAPI_OPERATION, op);
232633
         }
232633
         rc = (*sub_fn)(pipb, fsub->sf_initial, fsub->sf_any, fsub->sf_final, va);
232633
     } else {
232633
-- 
232633
2.21.0
232633