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.7.1~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=110cac8429bdf660e7749ced7054b0d1728df75c;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 9fb77b12..e5dcf1d8 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();