Tk Source Code

Check-in [2d944be2]
Login

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

Overview
Comment:Fix [1652598]: Free memory read tkOption.c SetupStacks

ExtendStacks() can add elements to the option stack being scanned and reallocate it, so the loop kept reading the old array. Fetch the element anew on each iteration.

Downloads: See separate download page
Timelines: family | ancestors | descendants | both | option-stack-realloc
Files: files | file ages | folders
SHA3-256: 2d944be2596a8bf63c77ab64809cb29028691a38a119f4d09cb93707a658120f
User & Date: serhiy.storchaka 2026-09-29 08:48:37.144
Context
2026-10-08
10:43
Fix for [1652598]: Free memory read by SetupStacks in tkOption.c. check-in: 6043b105 user: csaba tags: trunk, main
2026-09-29
08:48
Fix [1652598]: Free memory read tkOption.c SetupStacks

ExtendStacks() can add elements to the option stack being scanned and reallocate it, so the loop kept reading the old array. Fetch the element anew on each iteration. closed check-in: 2d944be2 user: serhiy.storchaka tags: option-stack-realloc

07:47
Add (manual) testcase check-in: 018eee75 user: jan.nijtmans tags: trunk, main
Changes
Unified Diff Side-by-Side Diff Patch
Changes to generic/tkOption.c.
Changes to tests/option.test.