diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-05-19 11:00:04 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-05-19 11:00:04 (GMT) |
| commit | b4b177bc926f1e246054462ba147e0448a0a95e3 (patch) | |
| tree | 683daa1e2e627a09aad80ed74f28dc0e54a00218 /doc/StringObj.3 | |
| parent | 2e04ff831d043373741c9252f3ff791bbc2bbda9 (diff) | |
| download | tcl-b4b177bc926f1e246054462ba147e0448a0a95e3.zip tcl-b4b177bc926f1e246054462ba147e0448a0a95e3.tar.gz tcl-b4b177bc926f1e246054462ba147e0448a0a95e3.tar.bz2 | |
Elaborate TIP #481 implementation: Make clear that Tcl_GetUnicodeFromObj and Tcl_GetStringFromObj panic if lengthPtr points to an int and length > INT_MAX.
Also if sizeof(int) == sizeof(size_t), prefer the size_t variant of the functions
Diffstat (limited to 'doc/StringObj.3')
| -rw-r--r-- | doc/StringObj.3 | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/doc/StringObj.3 b/doc/StringObj.3 index c9bdd4a..2526a01 100644 --- a/doc/StringObj.3 +++ b/doc/StringObj.3 @@ -188,7 +188,9 @@ Even in the limited situations where writing to this pointer is acceptable, one should take care to respect the copy-on-write semantics required by \fBTcl_Obj\fR's, with appropriate calls to \fBTcl_IsShared\fR and \fBTcl_DuplicateObj\fR prior to any -in-place modification of the string representation. +in-place modification of the string representation. If \fIlengthPtr\fR +points to an \fBint\fR variable, and the string has more than 2^31 bytes, +a panic will result. The procedure \fBTcl_GetString\fR is used in the common case where the caller does not need the length of the string representation. @@ -200,7 +202,8 @@ value as a Unicode string. This is given by the returned pointer and byte pointer is owned by the value manager and should not be modified by the caller. The procedure \fBTcl_GetUnicode\fR is used in the common case where the caller does not need the length of the unicode string -representation. +representation. If \fIlengthPtr\fR points to an \fBint\fR variable, +and the string has more than 2^31 unicode characters, a panic will result. .PP \fBTcl_GetUniChar\fR returns the \fIindex\fR'th character in the value's Unicode representation. If the index is out of range or |
