summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs/lastfmlib/files/lastfmlib-0.4.0-out-of-bounds-trim.patch')
-rw-r--r--media-libs/lastfmlib/files/lastfmlib-0.4.0-out-of-bounds-trim.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/media-libs/lastfmlib/files/lastfmlib-0.4.0-out-of-bounds-trim.patch b/media-libs/lastfmlib/files/lastfmlib-0.4.0-out-of-bounds-trim.patch
new file mode 100644
index 000000000000..6c01a59269d4
--- /dev/null
+++ b/media-libs/lastfmlib/files/lastfmlib-0.4.0-out-of-bounds-trim.patch
@@ -0,0 +1,24 @@
+Fix out of bounds assertion with -D_GLIBCXX_ASSERTIONS on empty string in testsuite.
+--- a/lastfmlib/utils/stringoperations.cpp
++++ b/lastfmlib/utils/stringoperations.cpp
+@@ -40,7 +40,7 @@ void trim(std::string& aString)
+ {
+ size_t begin = 0;
+ size_t end = aString.size() - 1;
+-
++
+ while ( aString[begin] == ' ' || aString[begin] == '\t'
+ || aString[begin] == '\r' || aString[begin] == '\n')
+ {
+@@ -50,8 +50,10 @@ void trim(std::string& aString)
+ break;
+ }
+
+- if (begin == aString.size())
++ if (begin == aString.size()) {
+ aString = "";
++ return;
++ }
+
+ while ( aString[end] == ' ' || aString[end] == '\t'
+ || aString[end] == '\r' || aString[end] == '\n')