• Marko Mäkelä's avatar
    MDEV-20917 InnoDB is passing NULL to nonnull function parameters · bef843b9
    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.
    
    rec_init_offsets_temp(): Do allow def_val=NULL in the interface.
    
    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).
    bef843b9
data0data.ic 16.4 KB