Changes On Branch bug-ab123cfd3d
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch bug-ab123cfd3d Excluding Merge-Ins

This is equivalent to a diff from ded211eaf8 to 787712b4c7

2023-05-01
10:38
Fix [ab123cfd3d] - ubsan warning in ValidateFormat check-in: 3da8d2069c user: apnadkarni tags: trunk, main
06:51
Fix [ab123cfd3d] - ubsan scan warning. Closed-Leaf check-in: 787712b4c7 user: apnadkarni tags: bug-ab123cfd3d
06:41
Added missing bigdata constraint check-in: ded211eaf8 user: apnadkarni tags: trunk, main
2023-04-30
19:21
Merge 8.7 check-in: 4d1655a18b user: jan.nijtmans tags: trunk, main

Changes to generic/tclScan.c.
303
304
305
306
307
308
309

310

311
312
313
314
315
316
317
318
319
320
321
322
323
324






325
326
327
328
329
330
331
332


333
334

335
336
337
338
339
340
341
303
304
305
306
307
308
309
310

311
312
313
314

315
316
317
318
319
320




321
322
323
324
325
326
327
328
329
330
331
332


333
334
335

336
337
338
339
340
341
342
343







+
-
+



-






-
-
-
-
+
+
+
+
+
+






-
-
+
+

-
+







	if ((ch < 0x80) && isdigit(UCHAR(ch))) {	/* INTL: "C" locale. */
	    /*
	     * Check for an XPG3-style %n$ specification. Note: there must
	     * not be a mixture of XPG3 specs and non-XPG3 specs in the same
	     * format string.
	     */

	    /* assert(value is >= 0) because of the isdigit() check above */
	    long longVal = strtoul(format-1, &end, 10);	/* INTL: "C" locale. */
	    unsigned long long ull = strtoull(format-1, &end, 10);	/* INTL: "C" locale. */
	    if (*end != '$') {
		goto notXpg;
	    }
	    /* assert(longVal >= 0) because of the isdigit() check above */
	    format = end+1;
	    format += TclUtfToUniChar(format, &ch);
	    gotXpg = 1;
	    if (gotSequential) {
		goto mixedXPG;
	    }
	    objIndex = longVal - 1;
	    /* INT_MAX because 9.0 does not support more than INT_MAX-1 args */
	    if ((objIndex < 0) || objIndex >= INT_MAX ||
		(numVars && (objIndex >= numVars))) {
	    /* >=INT_MAX because 9.0 does not support more than INT_MAX-1 args */
	    if (ull == 0 || ull >= INT_MAX) {
		goto badIndex;
	    }
	    objIndex = (int) ull - 1;
	    if (numVars && (objIndex >= numVars)) {
		goto badIndex;
	    }
	    else if (numVars == 0) {
		/*
		 * In the case where no vars are specified, the user can
		 * specify %9999$ legally, so we have to consider special
		 * rules for growing the assign array. 'longVal' is guaranteed
		 * to be > 0.
		 * rules for growing the assign array. 'ull' is guaranteed
		 * to be > 0 and < INT_MAX as per checks above.
		 */
		xpgSize = (xpgSize > longVal) ? xpgSize : longVal;
		xpgSize = (xpgSize > (int)ull) ? xpgSize : (int)ull;
	    }
	    goto xpgCheckDone;
	}

    notXpg:
	gotSequential = 1;
	if (gotXpg) {