Skip to content
Tcl Source Code History Of Ticket 203792a48c2fbb32
Login

History Of Ticket 203792a48c2fbb32

Artifacts Associated With Ticket 203792a48c2fbb32

  1. Ticket change [48bb1e2e08] (rid 213606) by chrstphrchvz on 2023-04-22 08:05:33:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      Encountered during cmdAH.test and encoding.test for Tcl built with <tt>-fsanitize=shift-base</tt>:
      
      <blockquote><pre>
      <b>generic/tclEncoding.c:2779:27: <span style="color:firebrick">runtime error:</span> left shift of 255 by 24 places cannot be represented in type 'int' </b>
      </pre></blockquote>
      
      Avoid by casting to unsigned before shifting:
      <blockquote><pre>
      --- generic/tclEncoding.c.orig
      +++ generic/tclEncoding.c
      @@ -2774,9 +2774,9 @@ Utf32ToUtfProc(
      &nbsp;
              int prev = ch;
              if (flags & TCL_ENCODING_LE) {
      <span style="color:firebrick">-           ch = (src[3] & 0xFF) << 24 | (src[2] & 0xFF) << 16 | (src[1] & 0xFF) << 8 | (src[0] & 0xFF);</span>
      <span style="color:green">+           ch = <b>(unsigned int)</b>(src[3] & 0xFF) << 24 | (src[2] & 0xFF) << 16 | (src[1] & 0xFF) << 8 | (src[0] & 0xFF);</span>
              } else {
      <span style="color:firebrick">-           ch = (src[0] & 0xFF) << 24 | (src[1] & 0xFF) << 16 | (src[2] & 0xFF) << 8 | (src[3] & 0xFF);</span>
      <span style="color:green">+           ch = <b>(unsigned int)</b>(src[0] & 0xFF) << 24 | (src[1] & 0xFF) << 16 | (src[2] & 0xFF) << 8 | (src[3] & 0xFF);</span>
              }
              if (HIGH_SURROGATE(prev) && !LOW_SURROGATE(ch)) {
                  /* Bug [10c2c17c32]. If Hi surrogate not followed by Lo surrogate, finish 3-byte UTF-8 */
      </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. private_contact initialized to: "6133eb3026f9b10aa9b7b48da92ae2834fc225b0"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "chrstphrchvz"
    14. subsystem initialized to: "44. UTF-8 Strings"
    15. title initialized to: "Avoid signed integer overflow in Utf32ToUtfProc()"
    16. type initialized to: "Patch"
  2. Ticket change [caa8aaf160] (rid 213638) by jan.nijtmans on 2023-04-22 18:10:27:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2460057.25725707"
    3. closer changed to: "jan.nijtmans"
    4. icomment: "Thanks for the fix!. Closing"
    5. login: "jan.nijtmans"
    6. mimetype: "text/x-fossil-wiki"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"