svn commit: r425834 - in branches/2016Q4/lang/tcl85: . files
Kubilay Kocak
koobs at FreeBSD.org
Thu Nov 10 08:30:48 UTC 2016
Author: koobs
Date: Thu Nov 10 08:30:46 2016
New Revision: 425834
URL: https://svnweb.freebsd.org/changeset/ports/425834
Log:
MFH: r425331 - lang/tcl85: fix integer overflow and avoid segfault
PR: 214205
Submitted by: gahr
Approved by: ports-secteam (blanket)
Added:
branches/2016Q4/lang/tcl85/files/patch-bug214205
- copied unchanged from r425331, head/lang/tcl85/files/patch-bug214205
Modified:
branches/2016Q4/lang/tcl85/Makefile
Directory Properties:
branches/2016Q4/ (props changed)
Modified: branches/2016Q4/lang/tcl85/Makefile
==============================================================================
--- branches/2016Q4/lang/tcl85/Makefile Thu Nov 10 08:06:03 2016 (r425833)
+++ branches/2016Q4/lang/tcl85/Makefile Thu Nov 10 08:30:46 2016 (r425834)
@@ -3,6 +3,7 @@
PORTNAME= tcl
PORTVERSION= 8.5.19
+PORTREVISION= 1
CATEGORIES= lang
MASTER_SITES= TCLTK/tcl8_5 \
SF/tcl/Tcl/${PORTVERSION}
Copied: branches/2016Q4/lang/tcl85/files/patch-bug214205 (from r425331, head/lang/tcl85/files/patch-bug214205)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/2016Q4/lang/tcl85/files/patch-bug214205 Thu Nov 10 08:30:46 2016 (r425834, copy of r425331, head/lang/tcl85/files/patch-bug214205)
@@ -0,0 +1,46 @@
+Index: ../generic/tclListObj.c
+==================================================================
+--- ../generic/tclListObj.c
++++ ../generic/tclListObj.c
+@@ -853,12 +853,15 @@
+ */
+ 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));
++ if (interp != NULL) {
++ 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; /* Known <= LIST_MAX */
+
+
+Index: ../generic/tclListObj.c
+==================================================================
+--- ../generic/tclListObj.c
++++ ../generic/tclListObj.c
+@@ -844,15 +844,12 @@
+ if (first >= numElems) {
+ first = numElems; /* So we'll insert after last element. */
+ }
+ if (count < 0) {
+ count = 0;
+- } else if (numElems < first+count || first+count < 0) {
+- /*
+- * The 'first+count < 0' condition here guards agains integer
+- * overflow in determining 'first+count'
+- */
++ } else if (first > INT_MAX - count /* Handle integer overflow */
++ || numElems < first+count) {
+ count = numElems - first;
+ }
+
+ if (objc > LIST_MAX - (numElems - count)) {
+ if (interp != NULL) {
+
More information about the svn-ports-all
mailing list