summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-07-12 18:43:33 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-07-12 18:43:33 (GMT)
commit08536b4ed31c30a25a343c3c2619676e67a0c692 (patch)
tree744066e3373bc1e27e9b4d18fd0c1b25d4da5878 /Swiften/IDN
parentd181db064ee10c23f0f126f2feb0329ee2236d4c (diff)
downloadswift-contrib-08536b4ed31c30a25a343c3c2619676e67a0c692.zip
swift-contrib-08536b4ed31c30a25a343c3c2619676e67a0c692.tar.bz2
Fixed bug with illegal resource in JID resulting in empty resource.
Diffstat (limited to 'Swiften/IDN')
-rw-r--r--Swiften/IDN/StringPrep.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/Swiften/IDN/StringPrep.cpp b/Swiften/IDN/StringPrep.cpp
index ff01eed..d54fb0b 100644
--- a/Swiften/IDN/StringPrep.cpp
+++ b/Swiften/IDN/StringPrep.cpp
@@ -26,14 +26,13 @@ const Stringprep_profile* getLibIDNProfile(StringPrep::Profile profile) {
}
std::string StringPrep::getPrepared(const std::string& s, Profile profile) {
-
std::vector<char> input(s.begin(), s.end());
input.resize(MAX_STRINGPREP_SIZE);
if (stringprep(&input[0], MAX_STRINGPREP_SIZE, static_cast<Stringprep_profile_flags>(0), getLibIDNProfile(profile)) == 0) {
return std::string(&input[0]);
}
else {
- return "";
+ throw std::exception();
}
}