On Wed, Nov 22, 2006 at 03:26:29PM +0100, Jiri Palecek wrote:
> To the crash. I have discovered it was caused by nonexistent fonts,
> eg. those xserver claims to have, but for some reasons fails to
> load (You can simulate that by renaming the file with the font wmmount
> uses, but leaving fonts.dir intact). So it should be some checking
> of return value somewhere omitted.

(Thanks for lowering the severity for me, although I would have gone for
'normal' rather than 'minor' :)

Ah, yes, I noticed that problem a few weeks ago separately, after a glitch
in an X-related upgrade demolished all my fonts. wmmount doesn't check the
return value of its two calls to XLoadQueryFont(). Presumably this was done
because it uses two very basic fonts, yet fonts that could be missing
nevertheless.

This is the patch I wrote back then:

--- wmmount.c~  2006-10-28 12:03:12.000000000 +0200
+++ wmmount.c   2006-10-28 12:03:12.000000000 +0200
@@ -601,6 +601,10 @@
   if(font==NULL)
     font=NAMEFONT;
   xfs=XLoadQueryFont(dockapp_d, font);
+  if(xfs==NULL) {
+    fprintf(stderr, "wmmount: font %s not found\n", font);
+    exit(1);
+  }
 
   f_name=xfs->fid;
   namex=6-xfs->min_bounds.lbearing;
@@ -613,6 +617,10 @@
   if(font==NULL)
     font=USAGEFONT;
   xfs=XLoadQueryFont(dockapp_d, USAGEFONT);
+  if(xfs==NULL) {
+    fprintf(stderr, "wmmount: font %s not found\n", font);
+    exit(1);
   
   f_usage=xfs->fid;
   usagex=6-xfs->min_bounds.lbearing;

-- 
     2. That which causes joy or happiness.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to