Prevent buffer overruns when converting malformed UTF16 to UTF8. Ticket #3482. (CVS 5869)

FossilOrigin-Name: 3f657e88767f60d305dd6151e7aa54363341d052
This commit is contained in:
drh
2008-11-07 03:29:33 +00:00
parent 98c58356ae
commit bbf695d6ea
4 changed files with 23 additions and 11 deletions
+12 -1
View File
@@ -14,7 +14,7 @@
# that all strings passed to that function are aligned on an even
# byte boundary.
#
# $Id: utf16align.test,v 1.1 2006/02/16 18:16:38 drh Exp $
# $Id: utf16align.test,v 1.2 2008/11/07 03:29:34 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -81,4 +81,15 @@ do_test utf16align-1.3 {
} 0
integrity_check utf16align-1.4
# ticket #3482
#
db close
sqlite3 db :memory:
do_test utf16align-2.1 {
db eval {
PRAGMA encoding=UTF16be;
SELECT hex(ltrim(x'6efcda'));
}
} {6EFC}
finish_test