Skip to content

Commit

Permalink
do not allow users to create an empty font group (lite-xl#1303)
Browse files Browse the repository at this point in the history
  • Loading branch information
takase1121 authored Jan 4, 2023
1 parent 2638e96 commit b7e9ca6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/api/renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ static int f_font_group(lua_State* L) {
luaL_checktype(L, 1, LUA_TTABLE);

table_size = lua_rawlen(L, 1);
if (table_size <= 0)
return luaL_error(L, "failed to create font group: table is empty");
if (table_size > FONT_FALLBACK_MAX)
return luaL_error(L, "failed to create font group: table size too large");

Expand Down

0 comments on commit b7e9ca6

Please sign in to comment.