]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
x11font: fix handling of high-bit-set SBCS characters.
authorSimon Tatham <anakin@pobox.com>
Tue, 10 Jan 2017 22:22:49 +0000 (22:22 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 10 Jan 2017 22:22:49 +0000 (22:22 +0000)
commita76de8774bfcbbd54b6a0fa8d7815c6c0b20dfac
treefbefe19610d8b189bba69cf2cb0b8747ebc85465
parent225186cad26aa360f2fec9c5bfebcc960d234344
x11font: fix handling of high-bit-set SBCS characters.

I had mistakenly pulled a 'char' value out of a string and passed it
to x11_font_has_glyph and x11_char_struct, each of which takes its two
index bytes as int-typed parameters. But if chars are signed, that
turns high-bit-set characters into out-of-range array indices. Oops.

The range checks in x11_char_struct prevented that from causing any
problem worse than refusal to display any affected glyph. Even so,
that's not particularly helpful. Fixed by changing the index byte
parameters to unsigned char type.
unix/gtkfont.c