summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/IDN/LibIDNConverter.cpp')
-rw-r--r--Swiften/IDN/LibIDNConverter.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Swiften/IDN/LibIDNConverter.cpp b/Swiften/IDN/LibIDNConverter.cpp
index 2325015..e2a87be 100644
--- a/Swiften/IDN/LibIDNConverter.cpp
+++ b/Swiften/IDN/LibIDNConverter.cpp
@@ -78,6 +78,9 @@ boost::optional<std::string> LibIDNConverter::getIDNAEncoded(const std::string&
if (idna_to_ascii_8z(domain.c_str(), &output, IDNA_USE_STD3_ASCII_RULES) == IDNA_SUCCESS) {
std::string result(output);
free(output);
+ if (result.size() > 255) {
+ return boost::optional<std::string>();
+ }
return result;
}
else {