From: Lukáš Lalinský Date: Sat, 10 Mar 2012 07:46:20 +0000 (+0100) Subject: Avoid uint overflow in case the length + index is over UINT_MAX X-Git-Tag: v1.8beta~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dcdf4fd954e3213c355746fa15b7480461972308;p=taglib Avoid uint overflow in case the length + index is over UINT_MAX --- diff --git a/taglib/toolkit/tbytevector.cpp b/taglib/toolkit/tbytevector.cpp index 5edbfbfe..cb6a5a0f 100644 --- a/taglib/toolkit/tbytevector.cpp +++ b/taglib/toolkit/tbytevector.cpp @@ -363,7 +363,7 @@ ByteVector ByteVector::mid(uint index, uint length) const ConstIterator endIt; - if(length < 0xffffffff && length + index < size()) + if(length < size() - index) endIt = d->data.begin() + index + length; else endIt = d->data.end();