| Ticket UUID: | f326f30e82d6375cdf61819be8f605edb4eebafe | |||
| Title: | DestroyMenuInstance(): clear stale pointer | |||
| Type: | Patch | Version: | core-8-6-branch | |
| Submitter: | chrstphrchvz | Created on: | 2022-09-25 21:02:51 | |
| Subsystem: | 10. Generic Menus | Assigned To: | fvogel | |
| Priority: | 5 Medium | Severity: | Minor | |
| Status: | Closed | Last Modified: | 2022-09-27 17:48:18 | |
| Resolution: | Accepted | Closed By: | fvogel | |
| Closed on: | 2022-09-27 17:48:18 | |||
| Description: |
Currently DestroyMenuInstance() leaves a stale pointer in menuPtr->entries. However Tcl_Preserve(menuPtr) may have been called elsewhere, and so menuPtr is not necessarily about to be freed. The attached patch proposes setting menuPtr->entries to NULL instead, so that any existing use-after-free issues like [09a11fb1228f] (which do not always crash, but can misbehave) will become NULL dereferences (should always crash). | |||
| User Comments: |
fvogel added on 2022-09-27 17:48:18:
Merged into core-8-6-branch and trunk. Thanks! fvogel added on 2022-09-26 18:41:27: Indeed this shouldn't hurt. Let's see what comes out of [750cb87493]. | |||
Attachments:
- f326f30e82d6.diff [download] added by chrstphrchvz on 2022-09-25 21:04:20. [details]
