[Tkabber-dev] [tclxmpp] r160 committed - * xmpp/jid.tcl: Don't crash if stringprepped JID contains prohibited...

tclxmpp at googlecode.com tclxmpp at googlecode.com
Fri Feb 3 11:38:01 MSK 2012


Revision: 160
Author:   sgolovan
Date:     Thu Feb  2 23:37:16 2012
Log:      	* xmpp/jid.tcl: Don't crash if stringprepped JID contains  
prohibited
	  characters in it as they might be outside BMP which Tcl/Tk don't
	  support properly.

http://code.google.com/p/tclxmpp/source/detail?r=160

Modified:
  /trunk/ChangeLog
  /trunk/xmpp/jid.tcl

=======================================
--- /trunk/ChangeLog	Sun Feb 27 12:25:51 2011
+++ /trunk/ChangeLog	Thu Feb  2 23:37:16 2012
@@ -1,3 +1,9 @@
+2012-02-02  Sergei Golovan  <sgolovan at nes.ru>
+
+	* xmpp/jid.tcl: Don't crash if stringprepped JID contains prohibited
+	  characters in it as they might be outside BMP which Tcl/Tk don't
+	  support properly.
+
  2011-02-27  Sergei Golovan  <sgolovan at nes.ru>

  	* xmpp/disco.tcl: Removed [lassign] because it requires Tcl 8.5.
=======================================
--- /trunk/xmpp/jid.tcl	Mon Feb  1 10:41:48 2010
+++ /trunk/xmpp/jid.tcl	Thu Feb  2 23:37:16 2012
@@ -268,19 +268,25 @@
          if {[info exists NodesCache($node)]} {
              set node1 $NodesCache($node)
          } else {
-            set node1 [::stringprep::stringprep Nodeprep $node]
+            if {[catch {::stringprep::stringprep Nodeprep $node} node1]} {
+                set node1 [string tolower $node]
+            }
              set NodesCache($node) $node1
          }
          if {[info exists ServersCache($server)]} {
              set server1 $ServersCache($server)
          } else {
-            set server1 [::stringprep::stringprep Nameprep $server]
+            if {[catch {::stringprep::stringprep Nameprep $server}  
server1]} {
+                set server1 [string tolower $server]
+            }
              set ServersCache($server) $server1
          }
          if {[info exists ResourcesCache($resource)]} {
              set resource1 $ResourcesCache($resource)
          } else {
-            set resource1 [::stringprep::stringprep Resourceprep $resource]
+            if {[catch {::stringprep::stringprep Resourceprep $resource}  
resource1]} {
+                set resource1 $resource
+            }
              set ResourcesCache($resource) $resource1
          }
      } else {


More information about the Tkabber-dev mailing list