• Marko Mäkelä's avatar
    MDEV-20917 InnoDB is passing NULL to nonnull function parameters · 81453474
    Marko Mäkelä authored
    mem_heap_dup(): Avoid mem_heap_alloc() and memcpy() of data=NULL, len=0.
    
    trx_undo_report_insert_virtual(), trx_undo_page_report_insert(),
    trx_undo_page_report_modify(): Avoid memcpy(ptr, NULL, 0).
    
    dfield_data_is_binary_equal(): Correctly handle data=NULL, len=0.
    
    This clean-up was motivated by WITH_UBSAN, and no bug related to this
    was observed in the wild. It should be noted that undefined behaviour
    such as memcpy(ptr, NULL, 0) could allow compilers to perform unsafe
    optimizations, like it was the case in
    commit fc168c3a (MDEV-15587).
    81453474
mem0mem.h 11.7 KB