summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'libutils/String8.cpp')
-rw-r--r--libutils/String8.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libutils/String8.cpp b/libutils/String8.cpp
index 28be60fb5..69313ead7 100644
--- a/libutils/String8.cpp
+++ b/libutils/String8.cpp
@@ -79,6 +79,9 @@ void terminate_string8()
79static char* allocFromUTF8(const char* in, size_t len) 79static char* allocFromUTF8(const char* in, size_t len)
80{ 80{
81 if (len > 0) { 81 if (len > 0) {
82 if (len == SIZE_MAX) {
83 return NULL;
84 }
82 SharedBuffer* buf = SharedBuffer::alloc(len+1); 85 SharedBuffer* buf = SharedBuffer::alloc(len+1);
83 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); 86 ALOG_ASSERT(buf, "Unable to allocate shared buffer");
84 if (buf) { 87 if (buf) {