• Tom Lane's avatar
    Make replace(), split_part(), and string_to_array() behave somewhat sanely · 4ca7a2da
    Tom Lane authored
    when handed an invalidly-encoded pattern.  The previous coding could get
    into an infinite loop if pg_mb2wchar_with_len() returned a zero-length
    string after we'd tested for nonempty pattern; which is exactly what it
    will do if the string consists only of an incomplete multibyte character.
    This led to either an out-of-memory error or a backend crash depending
    on platform.  Per report from Wiktor Wodecki.
    4ca7a2da
varlena.c 64.7 KB