diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-02-18 20:48:59 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-02-18 20:48:59 (GMT) |
commit | 2473a591bfbd5b346e1900e3c1088496b0d17590 (patch) | |
tree | d4351873a596cd351ae0f6ade2cdbc3ae732aec7 /generic/tclScan.c | |
parent | 52ed230e6f1f0f90a1ee63afa7a4d9948fd336ae (diff) | |
download | tcl-2473a591bfbd5b346e1900e3c1088496b0d17590.zip tcl-2473a591bfbd5b346e1900e3c1088496b0d17590.tar.gz tcl-2473a591bfbd5b346e1900e3c1088496b0d17590.tar.bz2 |
Proposed fix for [bd94500678]: SEGFAULT by conversion of unicode (out of BMP) to byte-array.
Diffstat (limited to 'generic/tclScan.c')
-rw-r--r-- | generic/tclScan.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclScan.c b/generic/tclScan.c index fbfba2d..45035f1 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -882,8 +882,8 @@ Tcl_ScanObjCmd( offset = TclUtfToUniChar(string, &sch); i = (int)sch; #if TCL_UTF_MAX == 4 - if (!offset) { - offset = TclUtfToUniChar(string, &sch); + if ((offset == 1) && ((sch & 0xFC00) == 0xD800)) { + offset += TclUtfToUniChar(string+offset, &sch); i = (((i<<10) & 0x0FFC00) + 0x10000) + (sch & 0x3FF); } #endif |