Overview
| Artifact ID: | 2749dce1ba0fbd338b8e782a3dd7f8da6fd81ff2 |
|---|---|
| Ticket: | 3484402fffffffffffffffffffffffffffffffff
off-by-one address error in AppendUnicodeToUnicodeRep |
| User & Date: | pooryorick on 2012-02-04 18:04:55 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
[append var1 $var2], data-corruption, e.g., random bytes from memory, show up in $var1 problem traced to checkin f0785bb73d1ccd8a524b32c53d457c63b6bb912f, changes to AppendUnicodeToUnicodeRep, if (unicode >= stringPtr->unicode && unicode <= stringPtr->unicode + 1 + stringPtr->uallocated / sizeof(Tcl_UniChar)) { offset = unicode - stringPtr->unicode; } the "+1" seems to cause a comparison with the pointer immediately subsequent to the boundaries of stringPtr, and causing the 'unicode' to point to the wrong location after the ensuing realloc and offset manipulations. Removing resulted the bug disappearing: if (unicode >= stringPtr->unicode && unicode <= stringPtr->unicode + stringPtr->uallocated / sizeof(Tcl_UniChar)) { offset = unicode - stringPtr->unicode; } in order for the bug to be triggered, things have to fall just-so in memory, such that "unicode" is at the next address up from stringPtr. - foundin changed to: "obsolete: 8.5.11"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "pooryorick"
- subsystem changed to: "69. Other"
- title changed to:
off-by-one address error in AppendUnicodeToUnicodeRep
- type changed to: "Bug"