diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-08-06 01:10:08 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-08-06 01:10:08 +0000 |
commit | 50217e529f6c2c03a7a5790a3e1cd76207d8bada (patch) | |
tree | 107c6a4b0a828d6d509a0ffdced63dd88d88c72a | |
parent | 3a408db2343393a612fc6e801e714a0588745c8a (diff) | |
parent | df2e518ccf639daf045d99a2a76927a1d7046afd (diff) | |
download | core-android11-d1-s6-release.tar.gz |
Snap for 6740172 from df2e518ccf639daf045d99a2a76927a1d7046afd to rvc-d1-releaseandroid-11.0.0_r9android-11.0.0_r8android-11.0.0_r7android-11.0.0_r15android-11.0.0_r14android-11.0.0_r13android-11.0.0_r12android-11.0.0_r11android-11.0.0_r10android11-d1-s7-releaseandroid11-d1-s6-releaseandroid11-d1-s5-releaseandroid11-d1-s1-releaseandroid11-d1-release
Change-Id: I8e64de75589c8128e39ebe437ef4125021595597
-rw-r--r-- | init/AndroidTest.xml | 3 | ||||
-rw-r--r-- | libutils/String8.cpp | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/init/AndroidTest.xml b/init/AndroidTest.xml index 920dc6c58..95f97e3fd 100644 --- a/init/AndroidTest.xml +++ b/init/AndroidTest.xml @@ -29,4 +29,7 @@ <option name="module-name" value="CtsInitTestCases" /> <option name="runtime-hint" value="65s" /> </test> + <!-- Controller that will skip the module if a native bridge situation is detected --> + <!-- For example: module wants to run arm32 and device is x86 --> + <object type="module_controller" class="com.android.tradefed.testtype.suite.module.NativeBridgeModuleController" /> </configuration> diff --git a/libutils/String8.cpp b/libutils/String8.cpp index d13548e4c..9d50e0bc5 100644 --- a/libutils/String8.cpp +++ b/libutils/String8.cpp @@ -322,8 +322,14 @@ status_t String8::appendFormatV(const char* fmt, va_list args) n = vsnprintf(nullptr, 0, fmt, tmp_args); va_end(tmp_args); - if (n != 0) { + if (n < 0) return UNKNOWN_ERROR; + + if (n > 0) { size_t oldLength = length(); + if ((size_t)n > SIZE_MAX - 1 || + oldLength > SIZE_MAX - (size_t)n - 1) { + return NO_MEMORY; + } char* buf = lockBuffer(oldLength + n); if (buf) { vsnprintf(buf + oldLength, n + 1, fmt, args); |