Overview
| Artifact ID: | 4be8979801e6fc4c49a166693adf4f67d726c6849354fac8b1bfac6c264859f4 |
|---|---|
| Ticket: | 2570123b6384460203e0456861e04454296acc78
system encoding is not protected from freeing during encode/decode operations |
| User & Date: | apnadkarni on 2025-08-13 17:11:30 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-markdown"
- comment changed to:
Inspecting code, I have doubts about potential crashes from accessing freed encodings in multithreaded environments. Several functions have code similar to below: ``` if (encoding == NULL) // encoding is passed by caller encoding = systemEncoding; // systemEncoding is GLOBAL shared by threads Do some operations involving the encoding. ``` The issue I am wondering about is that the reference count on systemEncoding is not incremented in such cases. What happens if some other thread calls `encoding system` and changes the systemEncoding causing the original one in use above to be freed? Need to build a test case to verify above race condition but perhaps someone could corroborate or refute my analysis. And save me the trouble of creating the test case :-)
- foundin changed to: "8.6"
- is_private changed to: "0"
- login: "apnadkarni"
- priority changed to: "5 Medium"
- private_contact changed to: "9546e9877f1a8899e25a89082561ee694e7fb402"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "apnadkarni"
- subsystem changed to: "- New Builtin Commands"
- title changed to:
system encoding is not protected from freeing during encode/decode operations
- type changed to: "Bug"