• Marko Mäkelä's avatar
    MDEV-22387: Do not pass null pointer to some memcpy() · 94a520dd
    Marko Mäkelä authored
    Passing a null pointer to a nonnull argument is not only undefined
    behaviour, but it also grants the compiler the permission to optimize
    away further checks whether the pointer is null. GCC -O2 at least
    starting with version 8 may do that, potentially causing SIGSEGV.
    
    These problems were caught in a WITH_UBSAN=ON build with the
    Bug#7024 test in main.view.
    94a520dd
my_alloc.c 13.5 KB