diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-05-19 15:04:35 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-05-19 15:04:35 (GMT) |
commit | 38b14d2a41d19eb2cec5ebb6cb838e887643c0a9 (patch) | |
tree | 6dc682e3a1e15da17d07a67284e0b646867b52df /generic/tclObj.c | |
parent | fdedfe57992474d342bf1ecb84bc04ae0fd9aeb2 (diff) | |
parent | 53a20bbf1cf609252a8ec050ed68a139687e7ad0 (diff) | |
download | tcl-38b14d2a41d19eb2cec5ebb6cb838e887643c0a9.zip tcl-38b14d2a41d19eb2cec5ebb6cb838e887643c0a9.tar.gz tcl-38b14d2a41d19eb2cec5ebb6cb838e887643c0a9.tar.bz2 |
Merge 9.0
Diffstat (limited to 'generic/tclObj.c')
-rw-r--r-- | generic/tclObj.c | 6 |
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; } |