mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Fix unsigned comparison to properly detect integer underflows in
UTextNSStringAccess. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39976 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fbdb451bf5
commit
fc436a1ea4
2 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2016-07-12 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/GSICUString.m (UTextNSStringAccess): Fix unsigned
|
||||
comparison to properly detect integer underflows.
|
||||
|
||||
2016-07-06 Niels Grewe <niels.grewe@halbordnung.de>
|
||||
|
||||
* Tests/base/NSRegularExpression/basic.m: Test for -pattern
|
||||
|
|
|
@ -118,8 +118,11 @@ UTextNSStringAccess(UText *ut, int64_t nativeIndex, UBool forward)
|
|||
{
|
||||
nativeLimit = length;
|
||||
}
|
||||
nativeStart = nativeLimit - chunkSize;
|
||||
if (nativeStart < 0)
|
||||
if (nativeLimit >= chunkSize)
|
||||
{
|
||||
nativeStart = nativeLimit - chunkSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
nativeStart = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue