commit | 4925fc180ee87d4fd32a1c7d0e88ee11fe532226 | [log] [tgz] |
---|---|---|
author | Tim Kilbourn <tkilbourn@google.com> | Tue Aug 18 19:54:35 2015 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Tue Aug 18 19:54:35 2015 +0000 |
tree | b9001d444b155740bf940b131537bb372ef7ad64 | |
parent | 4ae66e19bb33d3d0f7d417ae5e5921ec61a807ba [diff] | |
parent | 1545cac07ad8bb772958027b5c9c309ca9b7b4d0 [diff] |
Merge "Use init to write usb typec props" into mnc-dr-dev
diff --git a/libutils/String8.cpp b/libutils/String8.cpp index 3323b82..1496602 100644 --- a/libutils/String8.cpp +++ b/libutils/String8.cpp
@@ -78,6 +78,9 @@ static char* allocFromUTF8(const char* in, size_t len) { if (len > 0) { + if (len == SIZE_MAX) { + return NULL; + } SharedBuffer* buf = SharedBuffer::alloc(len+1); ALOG_ASSERT(buf, "Unable to allocate shared buffer"); if (buf) {