Overview
| Artifact ID: | 56e9c0dfea01b716c94d7e13d9dd942f2f28e6a0 |
|---|---|
| Ticket: | 1267380fffffffffffffffffffffffffffffffff
UpdateStringOfList: overflow detection |
| User & Date: | dgp on 2005-08-23 19:17:24 |
Changes
- assignee changed to: "nijtmans"
- cmimetype changed to: "text/plain"
- comment changed to:
% set x [string repeat a 65536]; concat % set y [lrepeat 65536 $x]; concat % string length $y Segmentation fault The string rep of $y would need a buffer of 4295032831 bytes, but that exceeds INT_MAX. When the scanner (over-)estimates the buffer size, it tries to count up the need for 4295163905 bytes, but the calculation overflows, wraps around and it concludes the need for only 196609 bytes. This gets allocated easily, and we happily start writing to this way too short buffer until we march off into segfaulting . Would be better for the scanner to detect the overflow (any negative length should be the indicator) and Tcl_Panic, I think.
- foundin changed to: "obsolete: 8.5a4"
- priority changed to: "9 Immediate"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "dgp"
- subsystem changed to: "14. List Object"
- title changed to: "UpdateStringOfList: overflow detection"
- type changed to: "Bug"