| commit | 946533648c49f2700b6e0f73383699597649ee60 | [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 | 2bfde57237209675e2375ea66185a3e050ca246f [diff] | |
| parent | 8c12fdf4abee092df34e449fa91a66f999e34682 [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) {