summaryrefslogtreecommitdiffstats
path: root/tests/utf.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-06-08 12:38:56 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-06-08 12:38:56 (GMT)
commit74d42f2fe9fc80e12aa490ffea731ac8114183b5 (patch)
treea27339ac3118a7718eb23d23b75ffbd9380bbe9a /tests/utf.test
parent061893f84e1d06c45531c7a4d7a7384e144dc69b (diff)
parent4276e234955e8ecdc91fd5d2ebee1acbb35753ad (diff)
downloadtcl-74d42f2fe9fc80e12aa490ffea731ac8114183b5.zip
tcl-74d42f2fe9fc80e12aa490ffea731ac8114183b5.tar.gz
tcl-74d42f2fe9fc80e12aa490ffea731ac8114183b5.tar.bz2
merge core-8-6-branch
Diffstat (limited to 'tests/utf.test')
-rw-r--r--tests/utf.test15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/utf.test b/tests/utf.test
index 28981d6..422ab08 100644
--- a/tests/utf.test
+++ b/tests/utf.test
@@ -99,17 +99,24 @@ test utf-4.4 {Tcl_NumUtfChars: #u0000} {testnumutfchars testbytestring} {
testnumutfchars [testbytestring "\xC0\x80"]
} {1}
test utf-4.5 {Tcl_NumUtfChars: zero length, calc len} testnumutfchars {
- testnumutfchars "" 1
+ testnumutfchars "" 0
} {0}
test utf-4.6 {Tcl_NumUtfChars: length 1, calc len} {testnumutfchars testbytestring} {
- testnumutfchars [testbytestring "\xC2\xA2"] 1
+ testnumutfchars [testbytestring "\xC2\xA2"] 2
} {1}
test utf-4.7 {Tcl_NumUtfChars: long string, calc len} {testnumutfchars testbytestring} {
- testnumutfchars [testbytestring "abc\xC2\xA2\xe4\xb9\x8e\uA2\u4e4e"] 1
+ testnumutfchars [testbytestring "abc\xC2\xA2\xe4\xb9\x8e\uA2\u4e4e"] 10
} {7}
test utf-4.8 {Tcl_NumUtfChars: #u0000, calc len} {testnumutfchars testbytestring} {
- testnumutfchars [testbytestring "\xC0\x80"] 1
+ testnumutfchars [testbytestring "\xC0\x80"] 2
} {1}
+# Bug [2738427]: Tcl_NumUtfChars(...) no overflow check
+test utf-4.9 {Tcl_NumUtfChars: #u20AC, calc len, incomplete} {testnumutfchars testbytestring} {
+ testnumutfchars [testbytestring "\xE2\x82\xAC"] 2
+} {2}
+test utf-4.10 {Tcl_NumUtfChars: #u0000, calc len, overcomplete} {testnumutfchars testbytestring} {
+ testnumutfchars [testbytestring "\x00"] 2
+} {2}
test utf-5.1 {Tcl_UtfFindFirsts} {
} {}