mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
Shell: Avoid StringView OOB access in Formatter ctor
This commit is contained in:
parent
bbce061a61
commit
c90cf67dc6
1 changed files with 3 additions and 0 deletions
|
@ -24,6 +24,9 @@ public:
|
||||||
, m_source(source)
|
, m_source(source)
|
||||||
, m_cursor(cursor)
|
, m_cursor(cursor)
|
||||||
{
|
{
|
||||||
|
if (m_source.is_empty())
|
||||||
|
return;
|
||||||
|
|
||||||
size_t offset = 0;
|
size_t offset = 0;
|
||||||
for (auto ptr = m_source.end() - 1; ptr >= m_source.begin() && isspace(*ptr); --ptr)
|
for (auto ptr = m_source.end() - 1; ptr >= m_source.begin() && isspace(*ptr); --ptr)
|
||||||
++offset;
|
++offset;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue