commit | abe62623840ddb4fddbd03ac90f33eaee083066f | [log] [tgz] |
---|---|---|
author | TreeHugger Robot <treehugger-gerrit@google.com> | Thu Jul 30 21:34:33 2020 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Thu Jul 30 21:34:33 2020 +0000 |
tree | 5074b41ddd0c93b1023cd8832bd0db2942b06106 | |
parent | 1147253d8408679b915a1007137547772d50e47a [diff] | |
parent | ca2b34c5923aca34cb425c232d2eb29110a186de [diff] |
Merge "Fail explicitly on length overflow." into qt-qpr1-dev
diff --git a/libutils/String16.cpp b/libutils/String16.cpp index 818b171..caab1bd 100644 --- a/libutils/String16.cpp +++ b/libutils/String16.cpp
@@ -389,7 +389,7 @@ 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; }