adamwill / 389-ds-base

Forked from 389-ds-base 4 years ago
Clone

4272e8f Bug 750625 - Fix Coverity (11108) Sizeof not portable

Authored and Committed by Noriko Hosoi 12 years ago
    Bug 750625 - Fix Coverity (11108) Sizeof not portable
    
    https://bugzilla.redhat.com/show_bug.cgi?id=750625
    
    lib/libaccess/oneeval.cpp (ACLEvalBuildContext)
    
    Bug Description: Passing argument "8UL /* sizeof (PList_t *) */
    * ace->expr_term_index" to function "INTsystem_calloc_perm" and
    then casting the return value to "PList_t *" is suspicious. Did
    you intend to use "sizeof(PList_t)" instead of "sizeof (PList_t *)"?
    In this particular case sizeof(PList_t *) happens to be equal to
    sizeof(PList_t), but this is not a portable assumption.
    
    Fix Description: replace sizeof(PList_t *) with sizesof(PList_t).
    Note: PList_t is typedef of (PListStruct_t *).  I.e., sizeof(PList_t)
    and sizeof(PList_t *) are identical.  Therefore, this is not a major
    problem at all.
    
        
file modified
+1 -1