- bsc#1203982, tcl-interp-limit-time.patch: Fix a y2k38 problem

in [interp limit -time] .

OBS-URL: https://build.opensuse.org/package/show/devel:languages:tcl/tcl?expand=0&rev=153
This commit is contained in:
Reinhard Max 2023-02-06 18:31:46 +00:00 committed by Git OBS Bridge
parent bd41c9c239
commit 6648ead5cf
3 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,53 @@
Index: generic/tclInterp.c
==================================================================
--- generic/tclInterp.c
+++ generic/tclInterp.c
@@ -4684,11 +4684,11 @@
case OPT_SEC:
if (Tcl_LimitTypeEnabled(childInterp, TCL_LIMIT_TIME)) {
Tcl_Time limitMoment;
Tcl_LimitGetTime(childInterp, &limitMoment);
- Tcl_SetObjResult(interp, Tcl_NewLongObj(limitMoment.sec));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(limitMoment.sec));
}
break;
}
return TCL_OK;
} else if ((objc-consumedObjc) & 1 /* isOdd(objc-consumedObjc) */) {
@@ -4742,28 +4742,30 @@
"BADVALUE", NULL);
return TCL_ERROR;
}
limitMoment.usec = ((long) tmp)*1000;
break;
- case OPT_SEC:
+ case OPT_SEC: {
+ Tcl_WideInt sec;
secObj = objv[i+1];
(void) Tcl_GetStringFromObj(objv[i+1], &secLen);
if (secLen == 0) {
break;
}
- if (TclGetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK) {
+ if (TclGetWideIntFromObj(interp, objv[i+1], &sec) != TCL_OK) {
return TCL_ERROR;
}
- if (tmp < 0) {
+ if (sec < 0) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"seconds must be at least 0", -1));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP",
"BADVALUE", NULL);
return TCL_ERROR;
}
- limitMoment.sec = tmp;
+ limitMoment.sec = sec;
break;
+ }
}
}
if (milliObj != NULL || secObj != NULL) {
if (milliObj != NULL) {
/*

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Feb 6 18:29:45 UTC 2023 - Reinhard Max <max@suse.com>
- bsc#1203982, tcl-interp-limit-time.patch: Fix a y2k38 problem
in [interp limit -time] .
-------------------------------------------------------------------
Tue Jan 17 11:21:29 UTC 2023 - Reinhard Max <max@suse.com>

View File

@ -50,6 +50,7 @@ Source2: baselibs.conf
Source3: macros.tcl
Patch0: tcl-refchan-mode-needed.patch
Patch1: tcl-string-compare.patch
Patch2: tcl-interp-limit-time.patch
BuildRequires: autoconf
BuildRequires: pkg-config
BuildRequires: zlib-devel
@ -95,6 +96,7 @@ if ! test -d pkgs/itcl%itclver; then
fi
%patch0
%patch1
%patch2
# The SQLite extension is provided by the sqlite3 package,
# so don't build it here.