• Marko Mäkelä's avatar
    MDEV-22387: Static_binary_string::q_append() invokes memcpy on NULL · cb253b86
    Marko Mäkelä authored
    Invoking memcpy() on a NULL pointer is undefined behaviour
    (even if the length is 0) and gives the compiler permission to
    assume that the pointer is nonnull. Recent versions of GCC
    (starting with version 8) are more aggressively optimizing away
    checks for NULL pointers. This undefined behaviour would cause
    a SIGSEGV in the test main.func_encrypt on an optimized debug build
    on GCC 10.2.0.
    cb253b86
sql_string.h 29.1 KB