Overview
| Artifact ID: | 3cf8450693ce20bcf6cad1eb0b7341bcdac6f68051c5efefff34dadd91addcaa |
|---|---|
| Ticket: | 41b1406f515e092067103439e63caad5843039e3
AppendUtfToUtfRep(): undefined behavior involving pointers |
| User & Date: | chrstphrchvz on 2021-12-15 22:12:10 |
Changes
- closedate changed to: "2459564.42511973"
- closer changed to: "chrstphrchvz"
- icomment:
Re addendum: I too had wondered if <tt><</tt> should be used instead of <tt><=</tt>, but ultimately thought <tt><=</tt> is correct once I noticed that <tt>objPtr->length</tt> doesn’t include the terminating NUL, which <tt>bytes</tt> could be pointing to; even though <tt>numBytes</tt> (the length to append) should be 0 in such a case, causing the function to return early and not perform any arithmetic on a pointer to unowned memory (due to <tt>bytes</tt> not being recomputed after the source/destination buffer is moved).
- login: "chrstphrchvz"
- mimetype: "text/x-fossil-wiki"