LibCore: Fix a crash in CArgsParser

This commit is contained in:
Sergey Bugaev 2019-08-17 12:22:31 +03:00 committed by Andreas Kling
parent bec646c0bb
commit e0e1be8c33
Notes: sideshowbarker 2024-07-19 12:39:05 +09:00

View file

@ -108,7 +108,8 @@ int CArgsParser::parse_next_param(int index, char** argv, const int params_left,
bool CArgsParser::is_param_valid(const String& param_name)
{
return param_name.substring(0, m_prefix.length()) == m_prefix;
return param_name.length() >= m_prefix.length() &&
param_name.substring(0, m_prefix.length()) == m_prefix;
}
bool CArgsParser::check_required_args(const CArgsParserResult& res)