| Ticket UUID: | edd1a68d6ec3b578d0af12786975e3ab68580516 | |||
| Title: | Lack of bounds checking in argument parsing for some widgets | |||
| Type: | Bug | Version: | 9.0.3 | |
| Submitter: | makefile_dot_in | Created on: | 2025-12-04 22:33:44 | |
| Subsystem: | 23. Option Parsing | Assigned To: | jan.nijtmans | |
| Priority: | 5 Medium | Severity: | Minor | |
| Status: | Closed | Last Modified: | 2026-09-19 11:19:30 | |
| Resolution: | Fixed | Closed By: | jan.nijtmans | |
| Closed on: | 2026-09-18 16:00:53 | |||
| Description: |
For some options in certain widgets (e.g.
This appears to be caused by the custom argument parsing logic in | |||
| User Comments: |
jan.nijtmans added on 2026-09-18 16:00:53:
Now merged to all branches. Including new testcases! Many thanks! @serhiy.storchaka! serhiy.storchaka added on 2026-09-18 10:03:04: The fix [c289f69486] is on core-8-6-branch only; main and core-9-0-branch still crash. Branch frame-option-parity ([0f5f1d83f6]) applies the same check on main and adds tests for frame, toplevel and labelframe. chrstphrchvz added on 2025-12-17 17:48:28: Jan, thanks for committing the fix. Would it be a good idea to add a test like the following?
erikleunissen added on 2025-12-07 13:57:55: If the purpose of (objc % 2 == 1) is to determine whether the argument count is odd, then I believe that it's inefficient to perform a division followed by determining the remainder. A check on the last bit of objc is much more simple/efficient:
(objc & 1)
chrstphrchvz added on 2025-12-05 20:32:33: Given how simple it is to trigger this bug, I would suggest making a test case for it. I think Tk typically avoids this issue elsewhere by checking
marc_culler (claiming to be Marc Culler) added on 2025-12-05 16:14:53: That also causes a segfault on macOS with Tk 9.1. oehhar added on 2025-12-05 10:41:55: Can confirm the crash on 9.0.2 and windows. Harald | |||
Home
Timeline
Branches
Tags
Forum
Tickets
Download
Wiki