• bar@mysql.com's avatar
    Bug#27079 Crash while grouping empty ucs2 strings · 1b426d3c
    bar@mysql.com authored
    Problem: GROUP BY on empty ucs2 strings crashed server.
    Reason: sometimes mi_unique_hash() is executed with
    ptr=null and length=0, which means "empty string".
    The branch of code handling UCS2 character set
    was not safe against ptr=null and fell into and
    endless loop even if length=0 because of poiter
    arithmetic overflow.
    Fix: adding special check for length=0 to avoid pointer arithmetic
    overflow.
    1b426d3c
ctype-uca.c 452 KB