Skip to content
Tcl Source Code History Of Ticket 0061c7a476
Login

History Of Ticket 0061c7a476

Artifacts Associated With Ticket 0061c7a476

  1. Ticket change [701f028ce7] (rid 200217) by chrstphrchvz on 2022-04-16 16:40:27:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      UBSan (<tt>-fsanitize=shift-base</tt>) error:
      <blockquote><pre>
      <span style="font-weight:bold">tcl/generic/tclZipfs.c:470:55: <span style="color:crimson">runtime error:</span> left shift of 252 by 24 places cannot be represented in type 'int'</span>
      </pre></blockquote>
      
      Avoid by casting to <tt>unsigned int</tt> before shifting:
      <blockquote><pre>
      --- generic/tclZipfs.c.orig
      +++ generic/tclZipfs.c
      @@ -467,7 +467,8 @@ ZipReadInt(
              Tcl_Panic("out of bounds read(4): start=%p, end=%p, ptr=%p",
                      bufferStart, bufferEnd, ptr);
           }
      <span style="color:crimson">-    return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) | (ptr[3] << 24);</span>
      <span style="color:green">+    return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) |
      +           ((unsigned int)ptr[3] << 24);</span>
       }
       
       static inline unsigned short
      </pre></blockquote>
      
    5. foundin initialized to: "core-8-branch"
    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: "37. File System"
    14. title initialized to: "signed integer overflow in ZipReadInt()"
    15. type initialized to: "Patch"
  2. Ticket change [16845da8d4] (rid 200218) by chrstphrchvz on 2022-04-16 16:41:49:

    1. comment changed to:
      UBSan (<tt>-fsanitize=shift-base</tt>) error:
      <blockquote><pre>
      <span style="font-weight:bold">tcl/generic/tclZipfs.c:470:55: <span style="color:crimson">runtime error:</span> left shift of 252 by 24 places cannot be represented in type 'int'</span>
      </pre></blockquote>
      
      Avoid by casting to <tt>unsigned int</tt> before shifting:
      <blockquote><pre>
      --- generic/tclZipfs.c.orig
      +++ generic/tclZipfs.c
      @@ -467,7 +467,8 @@ ZipReadInt(
              Tcl_Panic("out of bounds read(4): start=%p, end=%p, ptr=%p",
                      bufferStart, bufferEnd, ptr);
           }
      <span style="color:crimson">-    return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) | (ptr[3] << 24);</span>
      <span style="color:green">+    return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) |
      +           ((unsigned int)ptr[3] << 24);</span>
       }
      &nbsp;
       static inline unsigned short
      </pre></blockquote>
      
    2. login: "chrstphrchvz"
    3. mimetype: "text/plain"
  3. Ticket change [17db8ac299] (rid 200225) by jan.nijtmans on 2022-04-18 16:56:32:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2459688.20593668"
    3. closer changed to: "jan.nijtmans"
    4. icomment:
      Fixed [22b545403f|here]
      
      Thanks for the report and the patch!
      
    5. login: "jan.nijtmans"
    6. mimetype: "text/x-fossil-wiki"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"