4b7184c Ticket #47659 - ldbm_usn_init: Valgrind reports Invalid read / SIGSEGV

Authored and Committed by nhosoi 6 years ago
    Ticket #47659 - ldbm_usn_init: Valgrind reports Invalid read / SIGSEGV
    
    Bug description: A suffix mapping tree could exist without the corresponding
    backend.  The existing code did not properly check the backend returned from
    slapi_mapping_tree_find_backend_for_sdn.  When NULL backend is returned, it
    triggers the NULL pointer dereference.
    
    Fix description: This patch added a NULL backend check to usn_get_last_usn,
    and moved a logging to the if clause where the backend is not NULL.
    
    https://fedorahosted.org/389/ticket/47659
    
    Reviewed by rmeggins@redhat.com (Thank you, Rich!!)
    
    (cherry picked from commit a6f66e7fcbd5d17d975cc2ac65806d7c64571254)
    (cherry picked from commit 6ad2397fa5d1319840d66f9ec47dfdd7bde8f129)
    (cherry picked from commit 412ec0e9c8367f2d1c446237cb2bc27791ea8e6c)