From: Kenichi Handa Date: Tue, 28 Jul 2009 02:09:52 +0000 (+0000) Subject: (font_parse_xlfd): Check DPI and AVGWIDTH properties more rigidly. X-Git-Tag: emacs-pretest-23.1.90~2005 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=087048cd5d94bd63dd71ed36fb79f0388275cf6e;p=emacs.git (font_parse_xlfd): Check DPI and AVGWIDTH properties more rigidly. --- diff --git a/src/ChangeLog b/src/ChangeLog index 4dd53f21981..523f19ff0c0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2009-07-28 Kenichi Handa + + * font.c (font_parse_xlfd): Check DPI and AVGWIDTH properties more + rigidly. + + * xfont.c (xfont_list_pattern): Don't ignore the return value of + font_parse_xlfd. Check font properties more rigidly. + 2009-07-27 Dan Nicolaescu * s/netbsd.h (SIGNALS_VIA_CHARACTERS): Remove, already defined in bsd-common.h diff --git a/src/font.c b/src/font.c index d2cd1febe93..cfc48523d12 100644 --- a/src/font.c +++ b/src/font.c @@ -1139,7 +1139,10 @@ font_parse_xlfd (name, font) } } - ASET (font, FONT_DPI_INDEX, INTERN_FIELD (XLFD_RESY_INDEX)); + val = INTERN_FIELD (XLFD_RESY_INDEX); + if (! NILP (val) && ! INTEGERP (val)) + return -1; + ASET (font, FONT_DPI_INDEX, val); val = INTERN_FIELD (XLFD_SPACING_INDEX); if (! NILP (val)) { @@ -1151,8 +1154,10 @@ font_parse_xlfd (name, font) p = f[XLFD_AVGWIDTH_INDEX]; if (*p == '~') p++; - ASET (font, FONT_AVGWIDTH_INDEX, - font_intern_prop (p, f[XLFD_REGISTRY_INDEX] - 1 - p, 0)); + val = font_intern_prop (p, f[XLFD_REGISTRY_INDEX] - 1 - p, 0); + if (! NILP (val) && ! INTEGERP (val)) + return -1; + ASET (font, FONT_AVGWIDTH_INDEX, val); } else {