summaryrefslogtreecommitdiffstats
path: root/generic/tclObj.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-05-19 15:04:35 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-05-19 15:04:35 (GMT)
commit38b14d2a41d19eb2cec5ebb6cb838e887643c0a9 (patch)
tree6dc682e3a1e15da17d07a67284e0b646867b52df /generic/tclObj.c
parentfdedfe57992474d342bf1ecb84bc04ae0fd9aeb2 (diff)
parent53a20bbf1cf609252a8ec050ed68a139687e7ad0 (diff)
downloadtcl-38b14d2a41d19eb2cec5ebb6cb838e887643c0a9.zip
tcl-38b14d2a41d19eb2cec5ebb6cb838e887643c0a9.tar.gz
tcl-38b14d2a41d19eb2cec5ebb6cb838e887643c0a9.tar.bz2
Merge 9.0
Diffstat (limited to 'generic/tclObj.c')
-rw-r--r--generic/tclObj.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 03dec9e..29c200f 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -1675,7 +1675,11 @@ TclGetStringFromObj(
}
}
if (lengthPtr != NULL) {
- *lengthPtr = (objPtr->length < INT_MAX)? objPtr->length: INT_MAX;
+ if (objPtr->length > INT_MAX) {
+ Tcl_Panic("Tcl_GetStringFromObj with 'int' lengthPtr"
+ "cannot handle such long strings. Please use 'size_t'");
+ }
+ *lengthPtr = (int)objPtr->length;
}
return objPtr->bytes;
}