Skip to content

Commit

Permalink
App::get_matches(): Fix buffer overrun
Browse files Browse the repository at this point in the history
Replacement of d5767a7 based on suggestion in #2613.

Co-authored-by: J-Donald Tournier <[email protected]>
  • Loading branch information
Lestropie and jdtournier committed May 10, 2023
1 parent 5489889 commit ebb35a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ namespace MR
inline void get_matches (vector<const Option*>& candidates, const OptionGroup& group, const std::string& stub)
{
for (size_t i = 0; i < group.size(); ++i) {
if (stub.compare (0, stub.size(), group[i].id, stub.size()) == 0)
if (stub.compare (0, stub.size(), std::string(group[i].id)) == 0)
candidates.push_back (&group[i]);
}
}
Expand Down

0 comments on commit ebb35a5

Please sign in to comment.