<i>SEGFAULT by conversion of unicode (out of BMP) to byte-array.</i> status still Pending with 3 other changes
by
.
D 2019-02-06T13:34:29.713
J icomment Just\sto\sexplain\son\sthe\sreal\sexample\swhat\sI\smean:\r\n\r\n[https://github.com/AltSysrq/Abendstern/blob/106e1ad2457f7bfd90080eecf49a33f6079f8e1e/src/graphics/font.cxx#L101-L102|github/Abendstern/.../graphics/font.cxx#L101-L102]\r\n\r\n<code><pre>\r\n61\s\s\swhile\s(*str)\s{\r\n62\s\s\s\s\sif\s...\s{\r\n\s\s\s\s\s\s\s\s\s//\s...\slong\sblock\shere\s...\r\n100\s\s\s\s}\selse\s{\r\n101\s\s\s\s\s\sTcl_UniChar\sch;\r\n102\s\s\s\s\s\sstr\s+=\sTcl_UtfToUniChar(str,\s&ch);\r\n103\s\s\s\s\s\sch\s&=\s0xFFFF;\r\n104\s\s\s\s\s\sif\s(!hasLoaded[ch])\sconst_cast<Font*>(this)->renderCharacter(ch);\r\n\s\s\s\s\s\s\s\s\s//\s...\r\n107\s\s\s\s}\r\n108\s\s}\r\n</pre></code>\r\nAnd\sI\smean\snot\sthe\smodification\sof\s"ch"\s(in\sline\s103),\swhich\sstill\slooks\ssafe\sbut\scould\sbe\saffected\slater\sby\ssome\shigh\ssurrogates\s(larger\sas\sword)...\s\r\n\r\nBut\sas\syou\scan\ssee,\sthe\sthe\svariable\s"ch"\sis\slocal-scope\svariable\shere\s(let\salone\sit\sis\snot\sinitialized,\sbut\shas\sthe\sexistence\sin\sthis\sscope\sonly),\sso\sif\sthe\scompiler\soptimizes\sthis\sto\suse\sthe\sreserverd\sstack\sblock\s(for\ssome\sother\svariables/calls\sbetween\s61-101),\sthe\svalue\sof\sthis\smay\sbe\soverwritten,\sso\syou\swill\sget\sBO\sand/or\sendless\scycle.\r\n\r\nAnd\sI\sfound\sit\simmediatelly\sas\sI\sjust\sstarted\smy\ssearch\s(as\sI\shad\ssmall\spause\sonly),\sso\sI\swould\snot\sexclude\sthousands\sof\smodules/apps\scould\sbe\saffected\ssimilar\sways.
J login sebres
J mimetype text/x-fossil-wiki
K bd94500678e837d7ed50cf6d5000df8f38cd5e39
U sebres
Z c06be8070ac2341926094eabfe1ea376