From e08587db9aaf7f51090d47334f5cdc7b84be5dbe Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Sat, 26 May 2007 23:03:17 +0000 Subject: [PATCH] Don't allow address of zero-length array to be taken to prevent run-time errors with strict STL implementations. git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@668610 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- taglib/toolkit/tbytevector.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/taglib/toolkit/tbytevector.cpp b/taglib/toolkit/tbytevector.cpp index 8971e705..9b2bcc26 100644 --- a/taglib/toolkit/tbytevector.cpp +++ b/taglib/toolkit/tbytevector.cpp @@ -432,6 +432,9 @@ int ByteVector::endsWithPartialMatch(const ByteVector &pattern) const ByteVector &ByteVector::append(const ByteVector &v) { + if(v.d->size == 0) + return *this; // Simply return if appending nothing. + detach(); uint originalSize = d->size;