Overview
| Artifact ID: | a6440ba0254de898b4a297f82021e84b2022605b69780f3abe44609b06c852ad |
|---|---|
| Ticket: | f3cb2a32d60cf1386b08497b85434cf0177e7c6d
uninitialized value in format-2.18 |
| User & Date: | dgp on 2023-03-08 19:31:51 |
Changes
- closedate changed to: "2460012.31379317"
- icomment:
In test format-2.19 the access to uninitialized memory happens when generating the string rep of the argument "%s\uDE02". The first two characters are written as single-byte encoded UTF-8 into dst. Then the third character needs to be written starting at the 3rd byte of the string rep. Since the character U+DE02 is a low surrogate, it reads the 3rd and 4th byte to check for residue of a high surrogate, but those bytes are uninitialized. Moving the initialization to \0 inside the loop disrupts the surrogate history mechanism, so that's not an answer. Maybe a conditional initialization is possible, but getting really messy with callers of Tcl_UniCharToUtf() burdened with a lot of specialized knowledge to make the call in ways that reliably avoid this issue.
- login: "dgp"
- mimetype: "text/plain"