Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3cf8450693ce20bcf6cad1eb0b7341bcdac6f68051c5efefff34dadd91addcaa
Ticket: 41b1406f515e092067103439e63caad5843039e3
AppendUtfToUtfRep(): undefined behavior involving pointers
User & Date: chrstphrchvz on 2021-12-15 22:12:10
Changes

  1. closedate changed to: "2459564.42511973"
  2. closer changed to: "chrstphrchvz"
  3. icomment:
    Re addendum: I too had wondered if <tt>&lt;</tt> should be used instead of <tt>&lt;=</tt>, but ultimately thought <tt>&lt;=</tt> is correct once I noticed that <tt>objPtr-&gt;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).
    
  4. login: "chrstphrchvz"
  5. mimetype: "text/x-fossil-wiki"