Skip to content
Tcl Source Code History Of Ticket 85fc8bca03
Login

History Of Ticket 85fc8bca03

Artifacts Associated With Ticket 85fc8bca03

  1. Ticket change [9429a65a90] (rid 244833) by chrstphrchvz on 2025-08-31 22:50:10:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      Example UBSan error for the default case:
      <pre>
      % tcl::build-info boneless
      <b>tclBasic.c:755:36: <span style="color:firebrick">runtime error:</span> applying non-zero offset 1 to null pointer</b>
      0
      </pre>
      
      
      The error is due to <tt>p++</tt> being used as the for loop condition. I believe there is an instance of this in the <tt>ID_COMPILER</tt> case as well. One possible fix:
      
      <pre>
      --- generic/tclBasic.c
      +++ generic/tclBasic.c
      @@ -731,7 +731,8 @@
       	}
       	return TCL_OK;
           case ID_COMPILER:
      <span style="color:firebrick">-	for (p = strchr(buildData, '.'); p++; p = strchr(p, '.')) {</span>
      <span style="color:green">+	for (p = strchr(buildData, '.'); p != NULL; p = strchr(p, '.')) {
      +	    p++;</span>
       	    /*
       	     * Does the word begin with one of the standard prefixes?
       	     */
      @@ -752,7 +753,8 @@
       	break;
           default:		/* Boolean test for other identifiers' presence */
       	arg = TclGetStringFromObj(objv&#91;1&#93;, &len);
      <span style="color:firebrick">-	for (p = strchr(buildData, '.'); p++; p = strchr(p, '.')) {</span>
      <span style="color:green">+	for (p = strchr(buildData, '.'); p != NULL; p = strchr(p, '.')) {
      +	    p++;</span>
       	    if (!strncmp(p, arg, len)
       		    &amp;&amp; ((p&#91;len&#93; == '.') || (p&#91;len&#93; == '-') || (p&#91;len&#93; == '\0'))) {
       		if (p&#91;len&#93; == '-') {
      </pre>
      
    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: "54. Configuration Reporting"
    15. title initialized to: "Pointer arithmetic with NULL in buildInfoObjCmd()"
    16. type initialized to: "Bug"
  2. Ticket change [05edac02d5] (rid 244853) by jan.nijtmans on 2025-09-01 07:29:01:

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