mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +00:00
FontEditor+TextEditor+Playground: Refuse to load device files
This prevents the undefined behaviour that would come up as a result of doing so. (For example: opening "infinite" devices like /dev/full will result in an infinite loop until exhaustion of memory)
This commit is contained in:
parent
aff774c8ac
commit
77601e09c8
4 changed files with 31 additions and 2 deletions
|
@ -172,6 +172,9 @@ size_t BitmapFont::glyph_count_by_type(FontTypes type)
|
|||
|
||||
RefPtr<BitmapFont> BitmapFont::load_from_file(const StringView& path)
|
||||
{
|
||||
if (Core::File::is_device(path))
|
||||
return nullptr;
|
||||
|
||||
auto file_or_error = MappedFile::map(path);
|
||||
if (file_or_error.is_error())
|
||||
return nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue