Skip to content
Tcl Source Code History Of Ticket bca10e3790
Login

History Of Ticket bca10e3790

Artifacts Associated With Ticket bca10e3790

  1. Ticket change [c605a2269e] (rid 196943) by chrstphrchvz on 2021-12-28 23:11:04:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      <tt>ResultAdd()</tt> (generic/tclIOGT.c) is sometimes called with <tt>size_t toWrite = 0</tt> and a <tt>ResultBuffer *r</tt> such that <tt>r-&gt;buf = NULL</tt>. In this case, <tt>r-&gt;used = 0</tt> and <tt>r-&gt;allocated = 0</tt>, so <tt>ResultAdd()</tt> will not allocate a new buffer. This leads to <tt>NULL + 0</tt> pointer arithmetic when doing <tt>r-&gt;buf + r-&gt;used</tt>, and calling <tt>memcpy()</tt> with <tt>NULL</tt> as the destination (even though the copy length <tt>toWrite</tt> is 0), both of which are undefined behavior. [https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#available-checks|UBSan <tt>-fsanitize=nonnull-attribute</tt> (GCC) and <tt>-fsanitize=pointer-overflow</tt>] errors during test iogt-1.1:
      
      <pre>
      <span style="font-weight:bold">tcl/generic/tclIOGT.c:1445:5: <span style="color:red">runtime error:</span> null pointer passed as argument 1, which is declared to never be null
      tcl/generic/tclIOGT.c:1445:12: <span style="color:red">runtime error:</span> applying zero offset to null pointer</span>
      </pre>
      
    5. foundin initialized to: "8.6.12"
    6. is_private initialized to: "0"
    7. login: "chrstphrchvz"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Minor"
    11. status initialized to: "Open"
    12. submitter initialized to: "chrstphrchvz"
    13. subsystem initialized to: "52. Portability Support"
    14. title initialized to: "Undefined behavior in ResultAdd()"
    15. type initialized to: "Bug"
  2. Ticket change [4551874dfa] (rid 197039) by jan.nijtmans on 2022-01-13 11:41:58:

    1. assignee changed to: "jan.nijtmans"
    2. icomment:
      Suggested fix [acb2cec2bd31723a|here]. This also makes various functions in tclIOGT.c and tclIOTrans.c equal (since the ResultAdd() function in tclIOTrans.c didn't have this problem)
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/x-fossil-wiki"
    5. resolution changed to: "Fixed"
    6. status changed to: "Pending"
  3. Ticket change [b367cfe4e4] (rid 197091) by jan.nijtmans on 2022-01-14 22:49:53:

    1. closedate changed to: "2459594.4513112"
    2. closer changed to: "jan.nijtmans"
    3. login: "jan.nijtmans"
    4. mimetype: "text/plain"
    5. status changed to: "Closed"