Re: Bug in fc-cat with user cache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mike FABIAN <mfabian@xxxxxxx> さんは書きました:

> Thank you, with todays CVS fccat starts printing the contents of
> ~/.fonts.cache correctly now, but it crashes before finishing:
>
>     mfabian@magellan:~$ fc-cat ~/.fonts.cache-2

[...]

>     Aborted (core dumped)
>     mfabian@magellan:~$ 

I can fix that crash by the attached patch.

> And "xfd -fa" still crashes for all fonts afterwards:

This crash still remains.

fontconfig-2.3.93.20060109/fc-cat/CVSã? ã??ã?«ç?ºè¦?: Base
fontconfig-2.3.93.20060109/fc-cat/CVSã? ã??ã?«ç?ºè¦?: Baserev
fontconfig-2.3.93.20060109/fc-cat/CVSã? ã??ã?«ç?ºè¦?: Notify
diff -ru fontconfig-2.3.93.20060109.orig/fc-cat/fc-cat.c fontconfig-2.3.93.20060109/fc-cat/fc-cat.c
--- fontconfig-2.3.93.20060109.orig/fc-cat/fc-cat.c	2006-01-09 16:43:57.000000000 +0100
+++ fontconfig-2.3.93.20060109/fc-cat/fc-cat.c	2006-01-09 18:11:14.000000000 +0100
@@ -205,9 +205,12 @@
 	if (!FcDirCacheConsume (fd, name_buf, set, 0))
 	    goto bail1;
 
-	dir = strdup(name_buf);
+	dir = (char *) malloc (strlen (name_buf) + 2);
+	if (dir == NULL)
+	    goto bail1;
+	strncpy (dir, name_buf, strlen (name_buf) + 1);
 	strcat (dir, "/");
-
+	
 	FcCachePrintSet (set, dirs, dir);
 	free (dir);
 
-- 
Mike FABIAN   <mfabian@xxxxxxx>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。
_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig

[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux