2b40634 Ticket #47892 coverity defects found in 1.3.3.1

6 files Authored by rmeggins 4 years ago , Committed by nhosoi 4 years ago ,
    Ticket #47892 coverity defects found in 1.3.3.1
    
    https://fedorahosted.org/389/ticket/47892
    Reviewed by: mreynolds, nkinder (Thanks!)
    Branch: rhel-7.1
    Fix Description:
    9. 389-ds-base-1.3.3.1/ldap/servers/plugins/memberof/memberof.c:2079:var_compare_op – Comparing "group_norm_vals" to null implies that "group_norm_vals" might be null.
    11. 389-ds-base-1.3.3.1/ldap/servers/plugins/memberof/memberof.c:2099:var_deref_model – Passing null pointer "group_norm_vals" to function "slapi_valueset_add_value_ext(Slapi_ValueSet *, Slapi_Value const *, unsigned long)", which dereferences it.
    12. 389-ds-base-1.3.3.1/ldap/servers/slapd/valueset.c:896:2:deref_parm_in_call – Function "slapi_valueset_add_attr_valuearray_ext(Slapi_Attr const *, Slapi_ValueSet *, Slapi_Value **, int, unsigned long, int *)" dereferences "vs".
    15. 389-ds-base-1.3.3.1/ldap/servers/slapd/valueset.c:1075:2:deref_parm – Directly dereferencing parameter "vs".
    
    Added a check for group_norm_vals == NULL at beginning of function.  I think this had a chain effect causing 11, 12, and 15 as well.
    
    various - deprecated conversion from string constant - added const_cast<char *=""> as recommended by C++ guides.
    
    2. 389-ds-base-1.3.3.1/ldap/servers/slapd/back-ldbm/ldif2ldbm.c:2198:78:warning – 'j' may be used uninitialized in this function [-Wmaybe-uninitialized]
    
    Should have been using SLAPI_ATTR_TOMBSTONE_CSN
    
    2. 389-ds-base-1.3.3.1/ldap/servers/plugins/acl/aclparse.c:538:28:warning – 'is_target_to' may be used uninitialized in this function [-Wmaybe-uninitialized]
    
    2. 389-ds-base-1.3.3.1/ldap/servers/plugins/acl/acl.c:2493:26:warning – 'attrFilterArray' may be used uninitialized in this function [-Wmaybe-uninitialized]
    
    These are false positives.
    
    The minor memleaks were also fixed.
    
    Platforms tested: Fedora 20
    Flag Day: no
    Doc impact: no
    
    (cherry picked from commit 66e43aee7151acf6939b1a646eb869c7ccf0f7a4)
    (cherry picked from commit 6dc23ec794cd5644a40c223e7b66066f195d8d7d)
    
        
file modified
+5 -5
file modified
+1 -1