summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/LinkLocal/LinkLocalServiceInfo.cpp')
-rw-r--r--Swiften/LinkLocal/LinkLocalServiceInfo.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/Swiften/LinkLocal/LinkLocalServiceInfo.cpp b/Swiften/LinkLocal/LinkLocalServiceInfo.cpp
index 771251a..102b7f3 100644
--- a/Swiften/LinkLocal/LinkLocalServiceInfo.cpp
+++ b/Swiften/LinkLocal/LinkLocalServiceInfo.cpp
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2010-2013 Isode Limited. 2 * Copyright (c) 2010-2018 Isode Limited.
3 * All rights reserved. 3 * All rights reserved.
4 * See the COPYING file for more information. 4 * See the COPYING file for more information.
5 */ 5 */
@@ -82,7 +82,13 @@ LinkLocalServiceInfo LinkLocalServiceInfo::createFromTXTRecord(const ByteArray&
82 info.setNick(entry.second); 82 info.setNick(entry.second);
83 } 83 }
84 else if (entry.first == "port.p2pj") { 84 else if (entry.first == "port.p2pj") {
85 info.setPort(boost::lexical_cast<int>(entry.second)); 85 try {
86 info.setPort(boost::numeric_cast<unsigned short>(boost::lexical_cast<int>(entry.second)));
87 }
88 catch (const boost::bad_lexical_cast&) {
89 }
90 catch (const boost::numeric::bad_numeric_cast&) {
91 }
86 } 92 }
87 else if (entry.first == "status") { 93 else if (entry.first == "status") {
88 if (entry.second == "away") { 94 if (entry.second == "away") {