diff options
| author | Chong Yidong | 2009-01-24 03:17:42 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-01-24 03:17:42 +0000 |
| commit | e39280819e790687744367fae6f4e01449a75f30 (patch) | |
| tree | 4034be717f2b976f4c9e1ae16f04ecfb15c84596 | |
| parent | 289e7f8fbe73670a3bd001b6ab226c2d9ee33fbb (diff) | |
| download | emacs-e39280819e790687744367fae6f4e01449a75f30.tar.gz emacs-e39280819e790687744367fae6f4e01449a75f30.zip | |
(font_parse_xlfd): Handle patterns of length < 2.
| -rw-r--r-- | src/font.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/font.c b/src/font.c index 6eb77dc195d..0010c1c3eb7 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -1066,11 +1066,11 @@ font_parse_xlfd (name, font) | |||
| 1066 | Lisp_Object val; | 1066 | Lisp_Object val; |
| 1067 | char *p; | 1067 | char *p; |
| 1068 | 1068 | ||
| 1069 | if (len > 255) | 1069 | if (len > 255 || !len) |
| 1070 | /* Maximum XLFD name length is 255. */ | 1070 | /* Maximum XLFD name length is 255. */ |
| 1071 | return -1; | 1071 | return -1; |
| 1072 | /* Accept "*-.." as a fully specified XLFD. */ | 1072 | /* Accept "*-.." as a fully specified XLFD. */ |
| 1073 | if (name[0] == '*' && name[1] == '-') | 1073 | if (name[0] == '*' && (len == 1 || name[1] == '-')) |
| 1074 | i = 1, f[XLFD_FOUNDRY_INDEX] = name; | 1074 | i = 1, f[XLFD_FOUNDRY_INDEX] = name; |
| 1075 | else | 1075 | else |
| 1076 | i = 0; | 1076 | i = 0; |