diff --git a/kdump-do-not-iterate-past-end-of-string.patch b/kdump-do-not-iterate-past-end-of-string.patch new file mode 100644 index 0000000..d794624 --- /dev/null +++ b/kdump-do-not-iterate-past-end-of-string.patch @@ -0,0 +1,27 @@ +From: Petr Tesarik +Date: Fri May 28 11:30:48 2021 +0200 +Subject: URLParser::extractAuthority(): Do not iterate past end of string +References: bsc#1186037 +Upstream: merged +Git-commit: 208ed364ac926f800f37874d08e5b2c26547974e + +If there is no '/', '?' or '#' at the end of the authority part of +the URL, kdumptool must not crash. + +Signed-off-by: Petr Tesarik + +--- + kdumptool/urlparser.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/kdumptool/urlparser.cc ++++ b/kdumptool/urlparser.cc +@@ -117,7 +117,7 @@ string URLParser::extractAuthority(strin + + it += 2; + string::iterator const start = it; +- while (*it != '/' && *it != '?' && *it != '#') ++ while (it != end && *it != '/' && *it != '?' && *it != '#') + ++it; + + return string(start, it); diff --git a/kdump.changes b/kdump.changes index 5561790..76dabbf 100644 --- a/kdump.changes +++ b/kdump.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri May 28 09:36:47 UTC 2021 - Petr Tesařík + +- kdump-do-not-iterate-past-end-of-string.patch: Fix a crash caused + by iterating past end of string (bsc#1186037). + ------------------------------------------------------------------- Thu Apr 8 08:38:03 UTC 2021 - Petr Tesařík diff --git a/kdump.spec b/kdump.spec index 19276c2..cdeea31 100644 --- a/kdump.spec +++ b/kdump.spec @@ -37,6 +37,7 @@ Patch9: %{name}-use-pbl.patch Patch10: %{name}-on-error-option-yesno.patch Patch11: %{name}-mounts.cc-Include-sys-ioctl.h.patch Patch12: %{name}-Add-bootdev-to-dracut-command-line.patch +Patch13: %{name}-do-not-iterate-past-end-of-string.patch BuildRequires: asciidoc BuildRequires: cmake BuildRequires: gcc-c++ @@ -93,6 +94,7 @@ after a crash dump has occured. %patch10 -p1 %patch11 -p1 %patch12 -p1 +%patch13 -p1 %build export CXXFLAGS="%{optflags} -std=c++11"