diff --git a/src/common/unicode_norm.c b/src/common/unicode_norm.c index e2c5d25b6c2..f7c2d1f8589 100644 --- a/src/common/unicode_norm.c +++ b/src/common/unicode_norm.c @@ -342,6 +342,10 @@ unicode_normalize_kc(const pg_wchar *input) decomp_chars[decomp_size] = '\0'; Assert(decomp_size == current_size); + /* Leave if there is nothing to decompose */ + if (decomp_size == 0) + return decomp_chars; + /* * Now apply canonical ordering. */