+2008-05-15 Kenichi Handa <handa@m17n.org>
+
+ * fontset.c (Fnew_fontset): Call font_unparse_xlfd with 256-byte
+ buffer. Check the return value of it.
+
2008-05-14 Jason Rumney <jasonr@gnu.org>
* w32term.c (w32_get_glyph_overhangs): Remove.
{
Lisp_Object font_spec = Ffont_spec (0, NULL);
Lisp_Object short_name;
- char *xlfd;
+ char xlfd[256];
int len;
if (font_parse_xlfd (SDATA (name), font_spec) < 0)
Vfontset_alias_alist);
ASET (font_spec, FONT_REGISTRY_INDEX, Qiso8859_1);
fontset = make_fontset (Qnil, name, Qnil);
- xlfd = alloca (SBYTES (name) + 1);
- len = font_unparse_xlfd (font_spec, 0, xlfd, SBYTES (name) + 1);
+ len = font_unparse_xlfd (font_spec, 0, xlfd, 256);
+ if (len < 0)
+ error ("Invalid fontset name (perhaps too long): %s", SDATA (name));
FONTSET_ASCII (fontset) = make_unibyte_string (xlfd, len);
}
else