mirror of
https://github.com/uowuo/abaddon.git
synced 2026-08-15 05:19:58 +00:00
fix regex reading from freed memory (fixes #197)
This commit is contained in:
1 parent
857e94af38
commit
22025c2f0d
2 files changed
+4
-2
No files matched your search
+2
-1
@@ -54,7 +54,8 @@ std::optional<uint32_t> GetBuildNumberFromJSURL(const Glib::ustring &url, const
|
||||
|
||||
auto regex = Glib::Regex::create(R"("buildNumber",null!==\(t="(\d+)\"\))");
|
||||
Glib::MatchInfo match;
|
||||
if (regex->match(res.text, match)) {
|
||||
Glib::ustring string = res.text;
|
||||
if (regex->match(string, match)) {
|
||||
const auto str_value = match.fetch(1);
|
||||
try {
|
||||
return std::stoul(str_value);
|
||||
|
||||
Reference in new issue
Block a user