diff options
| -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; |