Prevent DoS attacks via requesting too many fallback fonts

This commit is contained in:
Kovid Goyal 2017-11-13 08:40:47 +05:30
parent a70f6405ac
commit ddc327b772
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -279,6 +279,8 @@ fallback_font(Cell *cell) {
}
}
if (fallback_fonts_count > 100) { fprintf(stderr, "Too many fallback fonts\n"); return NULL; }
if (bold) base_font = italic ? &bi_font : &bold_font;
else base_font = italic ? &italic_font : &medium_font;
if (!base_font->face) base_font = &medium_font;