• Sergei Petrunia's avatar
    MDEV-21341: Fix UBSAN failures: Issue Six · d531b4ee
    Sergei Petrunia authored
    (Variant #2 of the patch, which keeps the sp_head object inside the
    MEM_ROOT that sp_head object owns)
    (10.3 version of the fix, with handling for class sp_package)
    
    sp_head::operator new() and operator delete() were dereferencing sp_head*
    pointers to memory that didn't hold a valid sp_head object (it was
    not created/already destroyed).
    This caused UBSan to crash when looking up type information.
    
    Fixed by providing static sp_head::create() and sp_head::destroy() methods.
    d531b4ee
sp_head.h 57.9 KB