Artifact
558847a3926a113f6b4d08b8957947c6585c7b3b:
Attachment "tclI-2GB.patch" to
ticket [272e866f1e]
added by
gustafn
2013-11-12 19:07:45.
(unpublished)
--- tcl8.5.15/generic/tclIO.c-orig 2013-11-12 19:10:46.000000000 +0100
+++ tcl8.5.15/generic/tclIO.c 2013-11-12 19:27:56.000000000 +0100
@@ -5594,9 +5594,16 @@
* larger.
*/
- length = offset * 2;
if (offset < toRead) {
length = offset + toRead + 1;
+ } else {
+ length = offset * 2;
+ }
+ if (length < 0) {
+ if (((unsigned long)offset + toRead) > INT_MAX) {
+ Tcl_Panic( "file to large");
+ }
+ length = INT_MAX;
}
dst = (char *) Tcl_SetByteArrayLength(objPtr, length);
}