summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenno Fünfstück <benno.fuenfstueck@gmail.com>2015-11-14 21:18:41 +0100
committerMax Kellermann <max@duempel.org>2015-12-15 21:49:53 +0100
commitcae28117625153178cd91c85d13fc90acfc692be (patch)
tree70669bd46dfab44a1e3908562f970fe7dea72540
parent09112c686972f032aa91bfbd119adbe4c4943158 (diff)
fix mpd crash on invalid utf8 stream title
-rw-r--r--NEWS1
-rw-r--r--src/tag/TagString.cxx2
2 files changed, 2 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 702953a5e..f3649d7df 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,5 @@
ver 0.19.12 (not yet released)
+* fix assertion failure on malformed UTF-8 tag
* fix build failure on non-Linux systems
* fix LimitRTTIME in systemd unit file
diff --git a/src/tag/TagString.cxx b/src/tag/TagString.cxx
index 4f07cd62a..aab9bceb2 100644
--- a/src/tag/TagString.cxx
+++ b/src/tag/TagString.cxx
@@ -40,9 +40,9 @@ FindInvalidUTF8(const char *p, const char *const end)
/* now call the other SequenceLengthUTF8() overload
which also validates the continuations */
const size_t t = SequenceLengthUTF8(p);
- assert(s == t);
if (t == 0)
return p;
+ assert(s == t);
p += s;
}