String16::remove - avoid overflow am: 4048e49956 am: 107f18cb61 am: 9be245c3f0 am: 64fb5012b8
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619802 Change-Id: I03057c052a24f205c78ee600178d45e0cd51a3c1
This commit is contained in:
commit
4e27b6992b
1 changed files with 1 additions and 1 deletions
|
|
@ -389,7 +389,7 @@ status_t String16::remove(size_t len, size_t begin)
|
||||||
mString = getEmptyString();
|
mString = getEmptyString();
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
if ((begin+len) > N) len = N-begin;
|
if (len > N || len > N - begin) len = N - begin;
|
||||||
if (begin == 0 && len == N) {
|
if (begin == 0 && len == N) {
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue