diff --git a/2635.patch b/2635.patch index b2d1733..0aa07a1 100644 --- a/2635.patch +++ b/2635.patch @@ -1,4 +1,4 @@ -From 9e763df4e7be2e73c9b84001d85d0be8d8bb741c Mon Sep 17 00:00:00 2001 +From ae46ab4684bd31df4537475dc33234ae85c9b1e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Strau=C3=9Fberger?= Date: Tue, 17 May 2022 18:13:55 +0200 Subject: [PATCH] This and that @@ -8,9 +8,9 @@ May even solve: src/metadata/resolution.cc | 4 ++-- src/upnp_xml.cc | 4 ++-- src/util/process_executor.cc | 3 ++- - src/util/tools.cc | 14 ++++++++++++-- + src/util/tools.cc | 18 +++++++++++++++--- test/content/test_resolution.cc | 6 +++--- - 5 files changed, 21 insertions(+), 10 deletions(-) + 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/metadata/resolution.cc b/src/metadata/resolution.cc index 031cb5788..476c644e5 100644 @@ -65,10 +65,25 @@ index 5f238058a..8557175fe 100644 default: break; diff --git a/src/util/tools.cc b/src/util/tools.cc -index 119b74f5b..c549744be 100644 +index 119b74f5b..4470b6f17 100644 --- a/src/util/tools.cc +++ b/src/util/tools.cc -@@ -118,7 +118,17 @@ unsigned long stoulString(const std::string& str, int def, int base) +@@ -110,7 +110,13 @@ int stoiString(const std::string& str, int def, int base) + if (str.empty() || (str[0] == '-' && !std::isdigit(*str.substr(1).c_str())) || (str[0] != '-' && !std::isdigit(*str.c_str()))) + return def; + +- return std::stoi(str, nullptr, base); ++ try { ++ std::size_t pos; ++ return std::stoi(str, &pos, base); ++ } catch (const std::exception& ex) { ++ log_error("{} (input {})", ex.what(), str); ++ } ++ return def; + } + + unsigned long stoulString(const std::string& str, int def, int base) +@@ -118,7 +124,13 @@ unsigned long stoulString(const std::string& str, int def, int base) if (str.empty() || (str[0] == '-' && !std::isdigit(*str.substr(1).c_str())) || (str[0] != '-' && !std::isdigit(*str.c_str()))) return def; @@ -76,10 +91,6 @@ index 119b74f5b..c549744be 100644 + try { + std::size_t pos; + return std::stoul(str, &pos, base); -+ } catch (const std::invalid_argument& iaex) { -+ log_error("ia {} (input {})", iaex.what(), str); -+ } catch (const std::out_of_range& oorex) { -+ log_error("oor {} (input {})", oorex.what(), str); + } catch (const std::exception& ex) { + log_error("{} (input {})", ex.what(), str); + } @@ -87,7 +98,7 @@ index 119b74f5b..c549744be 100644 } void reduceString(std::string& str, char ch) -@@ -252,7 +262,7 @@ std::string urlEscape(std::string_view str) +@@ -252,7 +264,7 @@ std::string urlEscape(std::string_view str) if ((i + cplen) > str.length()) cplen = 1; diff --git a/gerbera.changes b/gerbera.changes index e96c58c..e37f471 100644 --- a/gerbera.changes +++ b/gerbera.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed May 25 09:36:13 UTC 2022 - Paolo Stivanin + +- Update 2635.patch + ------------------------------------------------------------------- Wed May 18 09:23:12 UTC 2022 - Paolo Stivanin