From c5b0b72ed7cbfd413896d9c9b0cb7bdcf521fc53 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 10 Nov 2015 16:31:29 +0000 Subject: [261a8a79f0] Integer overflow leads to segfault. --- generic/tclIO.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclIO.c b/generic/tclIO.c index 9a4735f..7bc849e 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -5938,7 +5938,7 @@ TranslateInputEOL( break; default: /* In other modes, at most 2 src bytes become a dst byte. */ - if (srcLen > 2 * dstLen) { + if (srcLen/2 > dstLen) { srcLen = 2 * dstLen; } break; -- cgit v0.12 From e93e78ae999879629f4db62379c05fd53ca4db57 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 13 Nov 2015 08:40:54 +0000 Subject: Fix [https://www.sqlite.org/src/info/34eb6911afee09e7|34eb6911af], taken over from SQLite: Fix uses of ctype functions (ex: isspace()) on signed characters in test programs and in some obscure extensions. No changes to the core. --- win/nmakehlp.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/win/nmakehlp.c b/win/nmakehlp.c index d0edcf0..84cf75c 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -498,9 +498,10 @@ GetVersionFromFile( p = strstr(szBuffer, match); if (p != NULL) { /* - * Skip to first digit. + * Skip to first digit after the match. */ + p += strlen(match); while (*p && !isdigit(*p)) { ++p; } @@ -605,8 +606,8 @@ SubstituteFile( sp = fopen(substitutions, "rt"); if (sp != NULL) { while (fgets(szBuffer, cbBuffer, sp) != NULL) { - char *ks, *ke, *vs, *ve; - ks = szBuffer; + unsigned char *ks, *ke, *vs, *ve; + ks = (unsigned char*)szBuffer; while (ks && *ks && isspace(*ks)) ++ks; ke = ks; while (ke && *ke && !isspace(*ke)) ++ke; @@ -615,7 +616,7 @@ SubstituteFile( ve = vs; while (ve && *ve && !(*ve == '\r' || *ve == '\n')) ++ve; *ke = 0, *ve = 0; - list_insert(&substPtr, ks, vs); + list_insert(&substPtr, (char*)ks, (char*)vs); } fclose(sp); } @@ -630,11 +631,11 @@ SubstituteFile( } } #endif - + /* * Run the substitutions over each line of the input */ - + while (fgets(szBuffer, cbBuffer, fp) != NULL) { list_item_t *p = NULL; for (p = substPtr; p != NULL; p = p->nextPtr) { @@ -654,7 +655,7 @@ SubstituteFile( } printf(szBuffer); } - + list_free(&substPtr); } fclose(fp); -- cgit v0.12 From 31b415218813b465bfd99d4d79ae85e95c90028f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 16 Nov 2015 10:32:40 +0000 Subject: =?UTF-8?q?Fix=20--enable-symbols=20build=20on=20Cygwin.=20Reporte?= =?UTF-8?q?d=20by=20Fran=C3=A7ois=20Vogel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unix/Makefile.in | 2 +- win/Makefile.in | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index 1f2cd77..84d0391 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -560,7 +560,7 @@ ${LIB_FILE}: ${STUB_LIB_FILE} ${OBJS} ${STUB_LIB_FILE}: ${STUB_LIB_OBJS} @if test "x${LIB_FILE}" = "xlibtcl${MAJOR_VERSION}.${MINOR_VERSION}.dll"; then \ - (cd ${TOP_DIR}/win; ${MAKE} libtclstub${MAJOR_VERSION}${MINOR_VERSION}.a); \ + (cd ${TOP_DIR}/win; ${MAKE} winextensions); \ fi rm -f $@ @MAKE_STUB_LIB@ diff --git a/win/Makefile.in b/win/Makefile.in index e9a28c4..ada9448 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -400,6 +400,8 @@ winhelp: $(ROOT_DIR)/tools/man2help.tcl $(MAN2TCL) ./$(TCLSH) "$(ROOT_DIR_NATIVE)"/tools/man2help.tcl tcl "$(VER)" $(TCL_DOCS) hcw /c /e tcl.hpj +winextensions: ${DDE_DLL_FILE} ${REG_DLL_FILE} + $(MAN2TCL): $(ROOT_DIR)/tools/man2tcl.c $(CC) $(CFLAGS_OPTIMIZE) $(MAN2TCLFLAGS) -o $(MAN2TCL) "$(ROOT_DIR_NATIVE)"/tools/man2tcl.c -- cgit v0.12 From 5498d8aaa43327e94fd652a66fde74f4187452db Mon Sep 17 00:00:00 2001 From: oehhar Date: Tue, 17 Nov 2015 17:07:33 +0000 Subject: Spanish translation of example corrected --- doc/msgcat.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/msgcat.n b/doc/msgcat.n index bae6dbe..b4f7140 100644 --- a/doc/msgcat.n +++ b/doc/msgcat.n @@ -321,7 +321,7 @@ the package. For example, a short \fBes.msg\fR might contain: .PP .CS namespace eval ::mypackage { - \fB::msgcat::mcflset\fR "Free Beer!" "Cerveza Gracias!" + \fB::msgcat::mcflset\fR "Free Beer" "Cerveza Gratis" } .CE .SH "RECOMMENDED MESSAGE SETUP FOR PACKAGES" -- cgit v0.12 From c32d032cbd7947d9e64e931df87fc4f374d81e7f Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 20 Nov 2015 15:47:30 +0000 Subject: [40f628e8e3] Tcl_ListObjReplace() callers need to handle TCL_ERROR. --- generic/tclCmdIL.c | 10 ++++++++-- generic/tclUtil.c | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index ea9c1e4..02e5812 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -2233,7 +2233,10 @@ Tcl_LinsertObjCmd( Tcl_ListObjAppendElement(NULL, listPtr, objv[3]); } else { - Tcl_ListObjReplace(NULL, listPtr, index, 0, (objc-3), &(objv[3])); + if (TCL_OK != Tcl_ListObjReplace(interp, listPtr, index, 0, + (objc-3), &(objv[3]))) { + return TCL_ERROR; + } } /* @@ -2598,7 +2601,10 @@ Tcl_LreplaceObjCmd( * optimize this case away. */ - Tcl_ListObjReplace(NULL, listPtr, first, numToDelete, objc-4, &(objv[4])); + if (TCL_OK != Tcl_ListObjReplace(interp, listPtr, first, numToDelete, + objc-4, &(objv[4]))) { + return TCL_ERROR; + } /* * Set the interpreter's object result. diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 69d0b17..bc1490e 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -1791,7 +1791,12 @@ Tcl_ConcatObj( TclListObjGetElements(NULL, objPtr, &listc, &listv); if (listc) { if (resPtr) { - Tcl_ListObjReplace(NULL, resPtr, INT_MAX, 0, listc, listv); + if (TCL_OK != Tcl_ListObjReplace(NULL, resPtr, + INT_MAX, 0, listc, listv)) { + /* Abandon ship! */ + Tcl_DecrRefCount(resPtr); + goto slow; + } } else { resPtr = TclListObjCopy(NULL, objPtr); } @@ -1808,6 +1813,7 @@ Tcl_ConcatObj( * the slow way, using the string representations. */ + slow: /* First try to pre-allocate the size required */ for (i = 0; i < objc; i++) { element = TclGetStringFromObj(objv[i], &elemLength); -- cgit v0.12 From dfbac0054227702fab645e6c03d08c35a8dd9b7c Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 20 Nov 2015 16:58:11 +0000 Subject: [3293874] Simplified fix (not backport). Also detect >LIST_MAX early. --- generic/tclListObj.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 289cf2d..c4b5cfc 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -854,8 +854,13 @@ Tcl_ListObjReplace( count = numElems - first; } + if (objc > LIST_MAX - (numElems - count)) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "max length of a Tcl list (%d elements) exceeded", LIST_MAX)); + return TCL_ERROR; + } isShared = (listRepPtr->refCount > 1); - numRequired = numElems - count + objc; + numRequired = numElems - count + objc; /* Known <= LIST_MAX */ for (i = 0; i < objc; i++) { Tcl_IncrRefCount(objv[i]); @@ -906,6 +911,8 @@ Tcl_ListObjReplace( listRepPtr = AttemptNewList(interp, newMax, NULL); if (listRepPtr == NULL) { + listRepPtr = AttemptNewList(interp, numRequired, NULL); + if (listRepPtr == NULL) { for (i = 0; i < objc; i++) { /* See bug 3598580 */ #if TCL_MAJOR_VERSION > 8 @@ -916,6 +923,7 @@ Tcl_ListObjReplace( } return TCL_ERROR; } + } listPtr->internalRep.twoPtrValue.ptr1 = (void *) listRepPtr; listRepPtr->refCount++; -- cgit v0.12 From 81929af166648538e5b049b7d0e1cd2b24906d08 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 24 Nov 2015 15:05:15 +0000 Subject: Fix comments at the top of the *.decls files, which are not correct any more for a long long time. --- generic/tcl.decls | 4 ++-- generic/tclInt.decls | 5 ++--- generic/tclTomMath.decls | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/generic/tcl.decls b/generic/tcl.decls index 28cee54..92ccdcf 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -2,8 +2,8 @@ # # This file contains the declarations for all supported public # functions that are exported by the Tcl library via the stubs table. -# This file is used to generate the tclDecls.h, tclPlatDecls.h, -# tclStub.c, and tclPlatStub.c files. +# This file is used to generate the tclDecls.h, tclPlatDecls.h +# and tclStubInit.c files. # # Copyright (c) 1998-1999 by Scriptics Corporation. # Copyright (c) 2001, 2002 by Kevin B. Kenny. All rights reserved. diff --git a/generic/tclInt.decls b/generic/tclInt.decls index 102d04b..920116c 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -2,9 +2,8 @@ # # This file contains the declarations for all unsupported # functions that are exported by the Tcl library. This file -# is used to generate the tclIntDecls.h, tclIntPlatDecls.h, -# tclIntStub.c, tclPlatStub.c, tclCompileDecls.h and tclCompileStub.c -# files +# is used to generate the tclIntDecls.h, tclIntPlatDecls.h +# and tclStubInit.c files # # Copyright (c) 1998-1999 by Scriptics Corporation. # Copyright (c) 2001 by Kevin B. Kenny. All rights reserved. diff --git a/generic/tclTomMath.decls b/generic/tclTomMath.decls index 1bfc443..ab39e83 100644 --- a/generic/tclTomMath.decls +++ b/generic/tclTomMath.decls @@ -3,7 +3,7 @@ # This file contains the declarations for the functions in # 'libtommath' that are contained within the Tcl library. # This file is used to generate the 'tclTomMathDecls.h' and -# 'tclTomMathStub.c' files. +# 'tclStubInit.c' files. # # If you edit this file, advance the revision number (and the epoch # if the new stubs are not backward compatible) in tclTomMathDecls.h -- cgit v0.12 From a90dcf7e3dbae2714513cbc09ec978dfcf21aa55 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 26 Nov 2015 11:46:02 +0000 Subject: On cygwin, install libtcl8.5.dll.a in the {prefix}/lib directory. On win32, don't create empty {prefix}/lib/tcl8/8.2 and {prefix}/lib/tcl8/8.3 directories any more during installing. --- unix/configure | 2 +- unix/tcl.m4 | 2 +- win/makefile.vc | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/unix/configure b/unix/configure index 692b801..a90aff3 100755 --- a/unix/configure +++ b/unix/configure @@ -8880,7 +8880,7 @@ fi MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' if test "${SHLIB_SUFFIX}" = ".dll"; then - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)";if test -f $(LIB_FILE).a; then $(INSTALL_DATA) $(LIB_FILE).a "$(LIB_INSTALL_DIR)"; fi;' DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" else diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 7a0b677..a7faae5 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -2069,7 +2069,7 @@ dnl # preprocessing tests use only CPPFLAGS. LIB_SUFFIX=${SHARED_LIB_SUFFIX} MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' AS_IF([test "${SHLIB_SUFFIX}" = ".dll"], [ - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)";if test -f $(LIB_FILE).a; then $(INSTALL_DATA) $(LIB_FILE).a "$(LIB_INSTALL_DIR)"; fi;' DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" ], [ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' diff --git a/win/makefile.vc b/win/makefile.vc index 267f53f..8c8ecdf 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -1012,10 +1012,6 @@ install-libraries: tclConfig install-msgs install-tzdata $(MKDIR) "$(SCRIPT_INSTALL_DIR)" @if not exist "$(SCRIPT_INSTALL_DIR)\..\tcl8$(NULL)" \ $(MKDIR) "$(SCRIPT_INSTALL_DIR)\..\tcl8" - @if not exist "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.2$(NULL)" \ - $(MKDIR) "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.2" - @if not exist "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.3$(NULL)" \ - $(MKDIR) "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.3" @if not exist "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.4$(NULL)" \ $(MKDIR) "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.4" @if not exist "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.4\platform$(NULL)" \ -- cgit v0.12