-2005-10-25 Jinghua Luo <sunmoon1997@gmail.com>
+2005-11-18 Frederic Crozat <fcrozat@mandriva.com>
+ reviewed by: plam
+
+ * fc-cat/fc-cat.c (main):
+
+ Don't crash when fc-cat invoked with no arguments.
+
+2005-11-18 Frederic Crozat <fcrozat@mandriva.com>
+ reviewed by: plam
+
+ * src/fcxml.c (FcConfigSaveAttr, FcConfigParseAndLoad):
+
+ Fix invalid read access caused by premature free and
+ GCC4 warnings in libxml2 codepath.
+
+2005-11-17 Jinghua Luo <sunmoon1997@gmail.com>
reviewed by: plam
* src/fccfg.c (FcConfigValues):
i = 1;
#endif
+ if (i >= argc)
+ usage (argv[0]);
+
if (FcCacheFileRead (fs, dirs, dirname (strdup(argv[i])), argv[i]))
FcCachePrintSet (fs, dirs, argv[i]);
return 0;
slen = 0;
for (i = 0; attr[i]; i++)
- slen += strlen (attr[i]) + 1;
+ slen += strlen ((char *) attr[i]) + 1;
n = i;
new = malloc ((i + 1) * sizeof (FcChar8 *) + slen);
if (!new)
printf ("\tLoading config file %s\n", filename);
f = fopen ((char *) filename, "r");
- FcStrFree (filename);
- if (!f)
+ if (!f) {
+ FcStrFree (filename);
goto bail0;
+ }
#if ENABLE_LIBXML2
memset(&sax, 0, sizeof(sax));
sax.endElement = FcEndElement;
sax.characters = FcCharacterData;
- p = xmlCreatePushParserCtxt (&sax, &parse, NULL, 0, filename);
+ p = xmlCreatePushParserCtxt (&sax, &parse, NULL, 0, (const char *) filename);
#else
p = XML_ParserCreate ("UTF-8");
#endif
+ FcStrFree (filename);
if (!p)
goto bail1;