• Vladislav Vaintroub's avatar
    MDEV-10951 Field_newdate::cmp access violation · 82ab92bd
    Vladislav Vaintroub authored
    The crash is caused by macro uint3korr() accessing memory (1 byte) past
    the end of allocated page. The macro is written such it reads 4 bytes
    instead of 3 and discards the value of the last byte.
    
    However, it is not always guaranteed that all uint3korr accesses will be
    valid (i.e that the caller allocates an extra byte after the value).
    
    In particular, the tree in Item_func_group_concat does not account for
    any extra bytes that it would need for comparison of keys in some cases
    (Field_newdate::cmp, Field_medium::cmp)
    
    The fix change uint3korr so it does not access extra bytes.
    82ab92bd
byte_order_generic_x86_64.h 3.67 KB