adamwill / 389-ds-base

Forked from 389-ds-base 4 years ago
Clone

960ad68 Ticket #49121 - ns-slapd crashes in ldif_sput due to the output buf size is less than the real size.

Authored and Committed by nhosoi 7 years ago
    Ticket #49121 - ns-slapd crashes in ldif_sput due to the output buf size is less than the real size.
    
    Description: There were missing pieces in the entry size calculation
    when an attribute had no a_present_values nor a_deleted_values.
    1) There was no chance to add the size of the attribute type name since
       preceding entry2str_internal_size_valueset did not add any size if
       the value was empty.  The type name size is now explicitly added.
    2) a_deletioncsn is added in entry2str_internal_put_attrlist by calling
       valueset_add_string with empty value.  The size was not included in
       the allocated memory to store the entire entry as a string. Now the
       size is added.
    
    Adding CI test ticket49121_test.py.
    
    https://pagure.io/389-ds-base/issue/49121
    
    Reviewed by wibrown@redhat.com (Thank you, William!!)
    
    (cherry picked from commit 543fe89edb0a6410a740a4fff738cace7bc57078)
    (cherry picked from commit 17fcd6fb80d2da563087f02bdfe9223d8d91c548)
    
        
file modified
+32 -23