From 2cc791d3d3ed8e16b0826e4612091887b465a44b Mon Sep 17 00:00:00 2001
From: pierre-luc <pierre-luc@aqra.ca>
Date: Tue, 21 Jul 2009 10:59:34 -0400
Subject: [PATCH] [#1872] Check if the user input is smaller than
 PJ_MAX_HOSTNAME.

---
 sflphone-common/src/sipaccount.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sflphone-common/src/sipaccount.cpp b/sflphone-common/src/sipaccount.cpp
index 09e4b5364e..cfb333972d 100644
--- a/sflphone-common/src/sipaccount.cpp
+++ b/sflphone-common/src/sipaccount.cpp
@@ -57,6 +57,10 @@ int SIPAccount::registerVoIPLink()
 
     /* Retrieve the account information */
     /* Stuff needed for SIP registration */
+    if (Manager::instance().getConfigString (_accountID, HOSTNAME).length() >= PJ_MAX_HOSTNAME) {
+        return !SUCCESS;
+    } 
+    
     setHostname (Manager::instance().getConfigString (_accountID, HOSTNAME));
     setUsername (Manager::instance().getConfigString (_accountID, USERNAME));
     setPassword (Manager::instance().getConfigString (_accountID, PASSWORD));
-- 
GitLab