commit | e949257f03552a0d3667ad393c532473ee4eb503 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Wed Oct 25 02:58:29 2017 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Wed Oct 25 02:58:29 2017 +0000 |
tree | f4fc21363c16a165e3f6583c317ac987a1a0273e | |
parent | 6d1c35650b163371babf7c81564a000bf49c0488 [diff] | |
parent | 98893802c24dc810b7952bec85a3c7017b26352b [diff] |
Merge "Fix copyFrom overflow when arg is UINT32_MAX."
diff --git a/base/HidlSupport.cpp b/base/HidlSupport.cpp index f857281..aec3fed 100644 --- a/base/HidlSupport.cpp +++ b/base/HidlSupport.cpp
@@ -217,7 +217,7 @@ void hidl_string::copyFrom(const char *data, size_t size) { // assume my resources are freed. - if (size > UINT32_MAX) { + if (size >= UINT32_MAX) { LOG(FATAL) << "string size can't exceed 2^32 bytes: " << size; } char *buf = (char *)malloc(size + 1);