Artifact
4be8979801e6fc4c49a166693adf4f67d726c6849354fac8b1bfac6c264859f4:
Ticket change
[4be8979801]
- New ticket
[2570123b63844602|2570123b63] <i>system encoding is not protected from freeing during encode/decode operations</i>.
by
apnadkarni on
2025-08-13 17:11:30.
D 2025-08-13T17:11:30.855
J assignee nobody
J closer nobody
J cmimetype text/x-markdown
J comment Inspecting\scode,\sI\shave\sdoubts\sabout\spotential\scrashes\sfrom\saccessing\sfreed\sencodings\sin\smultithreaded\senvironments.\sSeveral\sfunctions\shave\scode\ssimilar\sto\sbelow:\r\n\r\n```\r\nif\s(encoding\s==\sNULL)\s//\sencoding\sis\spassed\sby\scaller\r\n\s\s\sencoding\s=\ssystemEncoding;\s//\ssystemEncoding\sis\sGLOBAL\sshared\sby\sthreads\r\n\r\nDo\ssome\soperations\sinvolving\sthe\sencoding.\s\r\n\r\n```\r\n\r\nThe\sissue\sI\sam\swondering\sabout\sis\sthat\sthe\sreference\scount\son\ssystemEncoding\sis\snot\sincremented\sin\ssuch\scases.\sWhat\shappens\sif\ssome\sother\sthread\scalls\s`encoding\ssystem`\sand\schanges\sthe\ssystemEncoding\scausing\sthe\soriginal\sone\sin\suse\sabove\sto\sbe\sfreed?\r\n\r\nNeed\sto\sbuild\sa\stest\scase\sto\sverify\sabove\srace\scondition\sbut\sperhaps\ssomeone\scould\scorroborate\sor\srefute\smy\sanalysis.\sAnd\ssave\sme\sthe\strouble\sof\screating\sthe\stest\scase\s:-)
J foundin 8.6
J is_private 0
J login apnadkarni
J priority 5\sMedium
J private_contact 9546e9877f1a8899e25a89082561ee694e7fb402
J resolution None
J severity Important
J status Open
J submitter apnadkarni
J subsystem -\sNew\sBuiltin\sCommands
J title system\sencoding\sis\snot\sprotected\sfrom\sfreeing\sduring\sencode/decode\soperations
J type Bug
K 2570123b6384460203e0456861e04454296acc78
U apnadkarni
Z 69584d108fe96b46a58197e87fd62384