diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php
index 61629e63838b1824088b2d77a09ea8ebc1495a93..774976c3a4a6f2e2e08e604e7a2634c5dd9bf732 100644
--- a/htdocs/societe/class/companybankaccount.class.php
+++ b/htdocs/societe/class/companybankaccount.class.php
@@ -110,6 +110,9 @@ class CompanyBankAccount extends Account
         {
             $this->create();
         }
+		
+		if (dol_strlen($this->domiciliation) > 255) $this->domiciliation = dol_trunc($this->domiciliation, 254, 'right', 'UTF-8', 1);
+		if (dol_strlen($this->owner_address) > 255) $this->owner_address = dol_trunc($this->owner_address, 254, 'right', 'UTF-8', 1);
 
         $sql = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET";
         $sql.= " bank = '" .$this->db->escape($this->bank)."'";
diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php
index 810984a4a408312c1cf374cd809a1b04eac81651..e4eb0ef705359e37ad78962cc0d48ef62fea0a99 100644
--- a/htdocs/societe/rib.php
+++ b/htdocs/societe/rib.php
@@ -541,7 +541,7 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer)
 	}
 
     print '<tr><td>'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="4">';
-    print '<textarea name="domiciliation" rows="4" cols="40">';
+    print '<textarea name="domiciliation" rows="4" cols="40" maxlength="255">';
     print $account->domiciliation;
     print "</textarea></td></tr>";
 
@@ -550,7 +550,7 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer)
     print "</td></tr>\n";
 
     print '<tr><td>'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="4">';
-    print "<textarea name=\"owner_address\" rows=\"4\" cols=\"40\">";
+    print "<textarea name=\"owner_address\" rows=\"4\" cols=\"40\" maxlength=\"255\">";
     print $account->owner_address;
     print "</textarea></td></tr>";
 
@@ -644,7 +644,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer)
     print '<td colspan="4"><input size="12" type="text" name="bic" value="'.GETPOST('bic').'"></td></tr>';
 
     print '<tr><td>'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="4">';
-    print '<textarea name="domiciliation" rows="4" cols="40">';
+    print '<textarea name="domiciliation" rows="4" cols="40" maxlength="255">';
     print GETPOST('domiciliation');
     print "</textarea></td></tr>";
 
@@ -653,7 +653,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer)
     print "</td></tr>\n";
 
     print '<tr><td>'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="4">';
-    print '<textarea name="owner_address" rows="4" cols="40">';
+    print '<textarea name="owner_address" rows="4" cols="40" maxlength="255">';
     print GETPOST('owner_address');
     print "</textarea></td></tr>";