From: Petr Menšík Date: Tue, 29 Jan 2019 17:07:44 +0000 (+0100) Subject: Fallback to ASCII on output IDN conversion error X-Git-Tag: v9.14.7~4^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a38aa7f674eccef23ba93439c3b6352bb6e2542c;p=thirdparty%2Fbind9.git Fallback to ASCII on output IDN conversion error It is possible dig used ACE encoded name in locale, which does not support converting it to unicode. Instead of fatal error, fallback to ACE name on output. (cherry picked from commit c8a871e908f932d35e42a363c1f571fbf38c8982) --- diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 36ea046d936..1aab4f2c7f9 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -4379,9 +4379,17 @@ idn_ace_to_locale(const char *src, char **dst) { */ res = idn2_to_unicode_8zlz(utf8_src, &local_src, 0); if (res != IDN2_OK) { - fatal("Cannot represent '%s' in the current locale (%s), " - "use +noidnout or a different locale", - src, idn2_strerror(res)); + /* + * Cannot represent in current locale. + * Output ACE form undecoded. + */ + res = idn2_to_ascii_8z(utf8_src, &local_src, 0); + if (res != IDN2_OK) { + fatal("Cannot represent '%s' " + "in the current locale nor ascii (%s), " + "use +noidnout or a different locale", + src, idn2_strerror(res)); + } } /*