Skip to content
Permalink
Browse files Browse the repository at this point in the history
Avoid uint overflow in case the length + index is over UINT_MAX
  • Loading branch information
lalinsky committed Mar 10, 2012
1 parent ab8a0ee commit dcdf4fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion taglib/toolkit/tbytevector.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit dcdf4fd

Please sign in to comment.