[441] in Athena Bugs

home help back first fref pref prev next nref lref last post

XTextExtents SEGV on undefined default char

daemon@ATHENA.MIT.EDU (Mark W. Eichin)
Tue Jun 14 17:49:06 1988

Date: Tue, 14 Jun 88 17:47:22 EDT
From: Mark W. Eichin <eichin@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU, xbugs@ATHENA.MIT.EDU
Using a font such as times-roman18, with no default char (or
specifically, a default char of 0 and a lowest char of 32) measuring
the XTextExtents of a string with undefined chars in it causes a
reference through uninitialized data. The fix is simple:
% diff /mit/x11dev/src/lib/X/XTextExt.c XTextExt.c
148c148
<           for (i=1; i < nchars; i++) {
---
>           for (i=1; i < n; i++) {

nchars is what the user passed in, n is the number of actual glyphs
created. XTextWidth in the same file is correct; I haven't checked
XTextExtents16.

				Mark Eichin
			<eichin@athena.mit.edu>
		SIPB Member & Project Athena ``Watchmaker'' 

home help back first fref pref prev next nref lref last post