String16::remove - avoid overflow am: 4048e49956
am: 107f18cb61
am: 9be245c3f0
am: 64fb5012b8
am: 4e27b6992b
am: 26b81f59d2
am: 8367a666b5
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619802 Change-Id: Ic25dca55b553b062edc4ced44ddef68b96428906
This commit is contained in:
commit
80c46b0541
|
@ -441,7 +441,7 @@ status_t String16::remove(size_t len, size_t begin)
|
|||
mString = getEmptyString();
|
||||
return OK;
|
||||
}
|
||||
if ((begin+len) > N) len = N-begin;
|
||||
if (len > N || len > N - begin) len = N - begin;
|
||||
if (begin == 0 && len == N) {
|
||||
return OK;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue