diff --git a/sflphone-common/src/sipaccount.cpp b/sflphone-common/src/sipaccount.cpp
index 09e4b5364e8ece2207e2d0066f0af6ecf437221d..cfb333972d0a1918b6494a9db09ba12a01343267 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));