Bug#294320: xfree86: fsListFontsWithXInfo lacks sanity check for FS_Error
Package: xfree86
Version: 4.3.0.dfsg.1-10+SVN
Severity: important
Tags: patch
Hi,
This patch fixes an X server segfault when a font server returns a
FS_Error for a fsListFontsWithXInfo request.
This is the case of xfstt, that currently returns a FS_Error for this
request.
This can be tested easily by installing xfstt and then running
"xlsfonts -l".
Patch tested and attached.
regards,
guillem
diff -Naurp xc.orig/lib/font/fc/fserve.c xc/lib/font/fc/fserve.c
--- xc.orig/lib/font/fc/fserve.c 2005-02-02 08:03:13.000000000 +0100
+++ xc/lib/font/fc/fserve.c 2005-02-02 08:28:14.000000000 +0100
@@ -2332,7 +2332,7 @@ fs_read_list_info(FontPathElementPtr fpe
_fs_free_props (&binfo->info);
rep = (fsListFontsWithXInfoReply *) fs_get_reply (conn, &ret);
- if (rep == 0)
+ if (!rep || rep->type == FS_Error)
{
if (ret == FSIO_BLOCK)
return StillWorking;
Reply to: