Skip to content

Commit

Permalink
Fix buffer-overflow in version string parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
grafikrobot committed Sep 3, 2023
1 parent 2bd9edf commit 58000de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/engine/mod_jam_builtin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ inline int get_version(const char *& s)
{
std::size_t len = 0;
auto val = std::stoi(s, &len);
s += len + 1;
s += len;
if (*s == '.') s += 1;
return val < 0 ? 0 : val;
}
catch (...)
Expand Down

0 comments on commit 58000de

Please sign in to comment.